[2.x] HtmlEditor switches between <b> and <span..font-weight:bold..> in FF
Reproduce in every HtmlEditor (ex.: http://extjs.com/deploy/ext/examples...dynamic.html):
Write 2 Lines of text, select the first and press 'Bold', switch to 'source view' and
back, select the second line, press 'Bold', switch to 'source view' and see the result:
PHP Code:
<b>line 1</b><br><span style="font-weight: bold;">line 2</span>
testet with FF 3 on Mac and Windows - <i> and <u> is the same.
Tried to fix with
PHP Code:
htmlEditor.getDoc().execCommand('styleWithCSS', false, false);
htmlEditor.getDoc().execCommand('useCSS', false, false);
but no change. After a switch to sourceview only <spans> were generated.
This is a big Problem if you want to use the HTML Code to generate a PDF File, where
only b,i,u allowed and noch CSS is suported.
use override to eliminate css
This seems to work in Ext 3.3.1:
Ext.override(Ext.form.HtmlEditor, {
relayCmd : function(cmd, value){
(function(){
this.focus();
this.execCmd('styleWithCSS', false);
this.execCmd(cmd, value);
this.updateToolbar();
}).defer(10, this);
},
});