How to make $generateHtmlFromNodes produce inline styles instead of predefined class names #3309
Unanswered
trevor-davis-dover
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
I would be interested in this too, inline styles seem a better way forward when potentially updating css later on could break layouts when saving HTML to the database instead of json |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm hoping to take the contents of a Lexical editor, convert it to html, and save it in a DB for usage elsewhere.
Right now, if I make bold and italicized text, the $generateHtmlFromNodes method gives me HTML content that looks like this:
This is fine to re-render later in a Lexical editor, but does me no good if I want to render this HTML in a different environment that does not understand these classnames. In this particular case, the italicization is dropped.
Is there anyway to instead get this method to produce an inline
styleattribute on theptag?Beta Was this translation helpful? Give feedback.
All reactions