forked from quocduan/wagtail_draftail_anchors
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Description:
In our project we have a model with "content" field built using StreamField. The field uses few different types of blocks. One of them is just RichTextBlock where we have enabled anchors using anchor-identifier feature from this library.
We found a bug that whenever we modify a piece of text to be a heading, the id value is not added to the html data. The process is shown below:
- We add a simple text with a part meant to be a heading (screenshot # 1)
2. We select this part and use the toolbar to convert it into a heading (screenshot # 2)
- Save or publish the page model
- The data stored in the database looks like this (no
id)
<h3 data-block-key=\"1ga2c\">I'm a piece of text meant to be a heading</h3><p data-block-key=\"eqk0d\"></p><p data-block-key=\"3liop\">I'm just text below</p>
- Re-saving/publishing adds an empty id value:
<h3 data-block-key=\"4jzq5\" id=\"\">I'm a piece of text meant to be a heading</h3><p data-block-key=\"eqk0d\"></p><p data-block-key=\"3liop\">I'm just text below</p>
- To fix the data we can edit any part of the text inside the block, so adding new text or just deleting and adding a character will help.
Using any other option to create a heading works as expected (using / with the features prompt, or choosing header type from the toolbar before typing any characters).
Django==4.2.6
wagtail==5.2.2
wagtail-draftail-anchors==0.6.0
Python == 3.11
Mr0grog
Metadata
Metadata
Assignees
Labels
No labels