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;
serializer._setup();
tinymce.each('b,i,u'.split(','), function(name) {
var rule = serializer.rules[name];
if (!rule) serializer.addRules(name);
});