Skip to content

'deserializeHTMLToDocumentFragment' changes HTML structure of div elements #565

Closed Answered by zbeyens
dmarchuk asked this question in Q&A
Discussion options

You must be logged in to vote

Here is the problem: the div element is not deserialized as a paragraph but as a leaf (text), you can see that it works for p instead. The reason behind that is div is too much generic and we don't want to create a paragraph for a div that can just be a "wrapper". The workaround is to use p or div + option p.deserialize to add a custom class name to the deserializer rules.

These are the default rules for paragraph.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@dmarchuk
Comment options

@zbeyens
Comment options

@dmarchuk
Comment options

Answer selected by zbeyens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
plugin:deserialize-html Html deserializer
2 participants
Converted from issue

This discussion was converted from issue #509 on March 09, 2021 18:36.