PDA

View Full Version : HtmlEditor.getValue() inserting unprintable characters



thomasmckay
25 Feb 2011, 9:13 PM
Ext version tested:


xds-1.0.3.2



Adapter used:





css used:


only default ext-all.css





Browser versions tested against:


____
FF3



Operating System:


WinXP



Description:


Extra characters inserted into HtmlEditor. The getValue() returned from the HtmlEditor after a very simple operation (type 'aaaa' then click center text button) has bad extra characters in it.



Test Case:



<<insert working code to reproduce the report >>


See this URL : http://


Steps to reproduce the problem:


foo
bar



The result that was expected:


foo
bar



The result that occurs instead:


foo
bar



Screenshot or Video:


attached



Debugging already done:


none



Possible fix:


not provided

thomasmckay
26 Feb 2011, 5:25 AM
This thread from a year ago is exactly the problem I am seeing: http://www.sencha.com/forum/showthread.php?91967-htmleditor-adding-characters

Condor
26 Feb 2011, 2:42 PM
Try this patch:

Ext.override(Ext.form.HtmlEditor, {
defaultValue: '<!-- Will be removed by the editor -->',
cleanDefaultValue: true,
cleanHtml: function(html) {
html = String(html);
if(Ext.isWebKit){
html = html.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi, '');
}
if(this.cleanDefaultValue){
html = html.replace(new RegExp(this.defaultValue), '');
}
return html;
}
});

thomasmckay
28 Feb 2011, 11:07 AM
Thanks! This worked.