You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using serializeHTMLFromNodes, withDeserializeHTML, and deserializeHTMLToDocument in my project.
Right now using these things out of the box, if a user types in some HTML in the Slate editor, it will not be escaped—and thus will live alongside the serialized HTML, and evaluated as part of the document structure during deserialization. Rather than as "plain text" content of a text node, even if that's how it existed in the original node structure.
The use case that I was actually testing on this was the Code Block plugin, trying to type in some HTML inside the code block, and was surprised to find it evaluated as HTML on the other side of deserialization. But I would like HTML escaped throughout the document.
I was wondering if anyone has come up with a way to escape and preserve HTML in a text node? Do I need to customize the serializer?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm using
serializeHTMLFromNodes
,withDeserializeHTML
, anddeserializeHTMLToDocument
in my project.Right now using these things out of the box, if a user types in some HTML in the Slate editor, it will not be escaped—and thus will live alongside the serialized HTML, and evaluated as part of the document structure during deserialization. Rather than as "plain text" content of a text node, even if that's how it existed in the original node structure.
The use case that I was actually testing on this was the Code Block plugin, trying to type in some HTML inside the code block, and was surprised to find it evaluated as HTML on the other side of deserialization. But I would like HTML escaped throughout the document.
I was wondering if anyone has come up with a way to escape and preserve HTML in a text node? Do I need to customize the serializer?
Beta Was this translation helpful? Give feedback.
All reactions