JackAdams / meteor-editable-text

Drop-in editable text widget for meteor

Home Page:http://editable-text-demo.taonova.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

trustHtml=true does not seem to work

micktaiwan opened this issue · comments

Using trustHtml=true, when I save the value (pressing enter in the input) I can see for 0.2 second that the HTML is correctly displayed and then it is stripped away from the value (when the value is reactively fetched back from the server maybe ?). Is there an issue with trustHtml ?

The trustHtml=true is to allow html stored in a document field to be displayed on the client as html rather than text. It's purpose is not to allow html to be from a client taken at face value and be stored in db documents; before the input value is stored in the db, the server strips away all (most of? I can't remember...) the html. To store html in the server, I think you need wysiwyg=true, usually with a package like babrahams:editable-text-wysiwyg-bootstrap-3 to give a little wysiwyg editor (which isn't much help if you don't use Bootstrap 3).

Thank you for this clarification.
wysiwyg=true does the trick although I don't need the editor since I am entering the html by hand.

But I don't understand the purpose of trustHtml. If some HTML is in the document, it will be displayed in the client, but at the next edition it will be lost. So what's the point of it ?

Yeah, good point. I can't remember what trustHtml was supposed to be for (it probably had a purpose 5 years ago). I never use it.