Wysiwyg HTML editor data storage

I am developing a Webapp with Wysiwyg editor with CKEditor . Now I am facing the problem of storing data in the database. I mean the data generated by the editor is in HTML. Should I store data directly in HTML? If I only save text, how do I get the tags to render information on page refresh? Thank.

PD: data from editor is caught by Javascript function.

enter image description here

+3


source to share


2 answers


Try the following:

parsed_html = $.parseHTML( html_text );

      



However, I'm not sure if you can store the parsed text in the database or not. I store them as raw html and then in the display I convert them.

+1


source


I think you should store the data directly in HTML to keep the text format when rendering.



If you only want to store text data, it is easier to use a text box or a text box.

+1


source







All Articles