Underline format problem

According to the documentation i would like to overwrite predefined formats using this settings:

formats: {
        bold : {inline : 'b' },  
        italic : {inline : 'i' },
        underline: { inline: 'u' }
    },

I insert "this is a text" into the editor and press the underline-button. This is the result (this gets saved to database too):

this is a text

Why do i get no u-tags, but the predefined span with underlined style? How do i get my lovely u-tags here?

EDIT: I do know that u-tags are deprecated, but i need them for compatibility reasons!

EDIT2: My solution thanks to the accepted answer:

I was able to use some code from the legacyoutput plugin. I used the inline_styles setting

inline_styles: false,

additionally ia dded the following code into one of my plugins onInit

serializer = ed.serializer;

// Force parsing of the serializer rules
serializer._setup();

// Check that deprecated elements are allowed if not add them
tinymce.each('b,i,u'.split(','), function(name) {
  var rule = serializer.rules[name];

  if (!rule) serializer.addRules(name);
});

5
задан Thariama 7 March 2011 в 15:21
поделиться