-
HTMLEditor: convert HTML to text and vice versa
HTMLEditor: convert HTML to text and vice versa
I've got an HTMLEditor and I need:
1. to save data in text format by setValue() function (without tags HTML and the tag <br> must be converted in #13)
2. read the text data by getValue() function and transform the text in HTML
Thanks!
-
Sencha - Senior Forum Manager
You can use RegExp to replace tags.
-
Sencha - Community Support Team
Hi nicolabaldo,
you can use regex to replace the html tag like this.
Ext.util.Format.stripTags(yourhtmleditor.ed.getContent({format: 'raw' }).replace(/<\/?p+>/gi, ' '))
It will remove all html tag and also replace <p> tag with space.
sword-it.com,
Sencha Developer House in
Turkey - Istanbul University Technopark Suite 204.

-
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us