issues while re-editing text using open-WysiWyg editor
I am using openWysiWyg editor in my website. This is attached to a text-area where I can type in the 开发者_JAVA百科content and the content is then saved to some php text file with the html tags intact. In the view page on my site i directly include this php file and everything works fine.
Recently I got requests to have some facility to re-edit the already submitted text. For that, I am using the same editor attached to a textarea and I read the contents of the file and pass it to the textarea as . The content get loaded in to the textarea and everything is fine excpet the following issue. If i try to re-edit something like "& lt ;pankaj & gt ;" - upon loading this content in the editor it gets converted to "< pankaj >< /pankaj >" upon submitting the new changes. So I am having two issues - why "& lt ;" is getting converted to '<' and why is this auto-completion of tags happening.
I figured out the editor does the following steps :
- take textarea.value in some string
- use document.write() to copy that value to the texarea's div which in itself is a iframe.
- upon submitting it takes object.innerHTML to get the contents and then I save it to the disk
the above issues doesnt happen for text - "i & lt ; 5".
why "& lt ;" is getting converted to '<'
The editor is disabling the escape character <
and replacing it with the literal <
why is this auto-completion of tags happening.
The editor is converting the unescaped tag to valid XHTML
the above issues doesnt happen for text - "i & lt ; 5".
That is a numeric comparison, not markup
精彩评论