-
-
Notifications
You must be signed in to change notification settings - Fork 599
Description
Describe the bug
When creating a heading block with level = 1, the serialized HTML stored in the database does not include the data-level="1" attribute.
This differs from other heading levels (H2, H3), which correctly include data-level="x" in the stored HTML.
As a result, when the HTML is later parsed and loaded into the editor, the H1 heading is mapped incorrectly to hnull. Interacting with this hnull block (for example, hovering over it) causes the editor to crash.
To Reproduce
Create a heading block with level = 1 (H1).
Save the document → check stored HTML → data-level attribute is missing.
Reload the document into the editor (HTML parsing).
The heading block is rendered as hnull.
Hover over the hnull heading → page crashes.
Expected Behavior
H1 blocks should be serialized with data-level="1" (same as other heading levels) so they parse correctly and do not produce hnull blocks.
Additional Notes
The issue appears to be in the serialization process for H1 headings.
Adding the missing data-level="1" to the stored text in DB, fixes the parsing/rendering issue.