Format underline problem

According to the documentation, I would like to overwrite the predefined formats using the following settings:

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

I paste “this is text” into the editor and click the underline button. This is the result (it is also stored in the database):

<p>thi<span style="text-decoration: underline;">s is a t</span>ext</p>

Why don't I have u-tags but a predefined range with underlined style? How do I get my beautiful u-tags here?

EDIT: I know that u-tags are out of date , but I need them for compatibility reasons!

EDIT2: My solution thanks to the accepted answer:

I managed to use some code from the legacyoutput plugin. I used the setting i nline_styles

inline_styles: false,

additionally included the following code in one of my onInit plugins

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
3

:

http://tinymce.moxiecode.com/wiki.php/Plugin:legacyoutput
(. )


, , , :

-, , :

<u> .

:

inline_styles.
CSS - span, <u>, <strike> .. , ( ) , .

:

:

tinyMCE.init({
    ...
    formats : {
        underline : {inline : 'u', exact : true}
        }

...

!

+11

, <u> SSRS 2008, <span style="text-decoration: underline;">.

:

inline_styles: false,
formats: {
    underline: { inline: 'u', exact : true }
}
+8

Does it work here?

http://jsfiddle.net/dFY6r/

Also, the tags uare outdated and b, and i, therefore, we are now using CSS:

.className {
    text-decoration: underline;
    font-weight: bold;
    font-style: italic;
}
0
source

All Articles