View Full Version : Htmleditor incorect source html

21 Aug 2012, 7:23 AM

I have some problems with the htmleditor. I'm using it for loading a XML file, modifying some text in it, and then save it.
I'm trying for over 3 days to find a solution, but in vain.

The problems are:
1) The <img src="" /> it's modified in <img src="" > (without the /)
2) Same for the br
3) attributes like "aplicationPath" are modified to "aplicationpath", with lower p

When I save the edited XML, it will be stored with this problems. Is there a way to load the XML file, without being modified?

Even if I copy paste the XML in the 'source edit', it's instantly modified, with the upper problems. And the source edit is unique for every browser.

Thank you very much,
Have a good day

21 Aug 2012, 10:27 AM
You could look at perhaps overriding the cleanHtml function and see if this help.


29 Aug 2012, 2:53 AM
Thank you for your answer Scott. I tried overriding the cleanHtml function :

Ext.override(Ext.form.field.HtmlEditor, {
cleanHtml: function(html) {

return html;
}) ;

It overrides the cleanHtml, but the result it's not the expected one . The html it's still instantly modified. And still the source code is unique for every browser. Perhaps i need to override another method ?


29 Aug 2012, 4:53 AM
Perhaps have a look at

fieldSubTpl [ ..]

It calls: Ext.util.Format.htmlEncode(values.value),


29 Aug 2012, 8:17 AM
I've attached an use case to better explain my Issue

Step 1: In "Source edit mode insert this piece of xml". Remember how swfFile is written and alternativePath


Step 2 : Toggle to Standard edit mode

Step 3 : Toggle back to "Source edit mode, and see the differences. Bot "swfFile" and "alternativePath" are lower case now.

Hope this will help,