Skip to content
Discussion options

You must be logged in to vote

The class stripping isn't a sanitization issue — it's how insert-editable-text works. That option converts the template's HTML into Lexical's editable document model, and Lexical nodes only carry the attributes they model (a <p> becomes a paragraph node that knows about format and indentation, a link keeps its href, etc.). Arbitrary attributes like class have nowhere to live, and the HTML you get back is regenerated from that model. So insert-editable-text is meant for inserting plain editable content, not for preserving custom markup.

For a self-contained styled snippet like yours, use the default attachment insertion instead — just drop insert-editable-text and give the prompt a name:

<%=

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jorgemanrubia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants