Open pbiron opened 3 years ago
FYI: this happens in both the post editor and the widget editor.
See #29838 where I asked for a UI for setting ID's on list items...
Just discovered that whatever the problem is it is NOT related to a change in 5.8, because it also seems to happen in 5.7.2 (I guess it's been a while since I edited any of the lists in production sites where I've added ID attributes :-)
Just my 2 cents.
Can replicate. Same WP setup, also with different standard themes. Also activating Gutenberg 11.0.0.
Custom IDs, classes or style (I just wanted to expand my tests adding more HTML there) added Edit as HTML
or via Code Editor get stripped also when you convert the list from unordered to ordered and viceversa.
After point 5 of the "Step-by-step reproduction instructions" if you Update the Post/Page where List block is inserted and inspect front-end, you'll see the custom IDs, classes or style. 3.1 At the same time, inspecting the Post/Page while editing, you'll never see the custom IDs, classes or style.
After Updating, you can reload while editing, custom IDs, classes or style persist, you can see them only with the Code Editor, not inspecting the page.
Following Slack related discussion I checked some other blocks. The Custom IDs can be added via Code Editor where the block in its Advanced settings has the HTML anchor
field available. Tested with Paragraph
, Heading
, Cover
, Buttons
, Media & Text
, Quote
blocks. HTML anchor
field gets populated.
5.1 If you try to add some not allowed HTML, like a simple style="color: red;"
or the equivalent style="color:#ff0000"
, all these blocks crash, and immediately offer to do an Attempt Block Recovery
action, which succefully removes the offending code. This is the way the blocks have been developed, it's not a bug, simply adding custom style in this way does not follow the block coding standards, and make the block crash. So it's an user error.
Coming back to the List Block, it's clear it has no granular control over the single <li>
items, you cannot assign different colors, or classes and IDs, therefore if added directly editing the HTML they get stripped out after a second edit.
Of course it's not correct that you can add them, and after a unique editing and update of the List Block, you can see them fornt-end
If you'll never edit this block again, you can have this live forever.
List Blocks with not allowed HTML code added on them, should crash like the other blocks. 7.1 This could be integrated while working at #29838.
This looks the same as the bug report I submitted back in February. I guess nobody's bothered about fixing this.
Is anyone working on this issue?
Is anyone working on this issue?
Assignees No one assigned
Doesn't look like it :(
I got this issue working on foot notes. For me, since on the end of every li theres a link to foot notes, worked with the id inside the link, example:
<li>List Item Text<a href="#footnotes1" id="textnote1">1</a></li>
Description
When a list block that has had ID attributes manually added to list items is edited (visually), the ID attributes on the list items are stripped out.
Step-by-step reproduction instructions
Expected behaviour
I expect the ID attributes to still be present
Actual behaviour
The ID attributes have been stripped out
Screenshots or screen recording (optional)
WordPress information
Device information