In Wordpress's Blocks editor, How do I insert a block inside a list item

Viewed 466

I have a list of text items and I want to add an image or a code element or any other block inside that list item. How is this accomplished with Wordpress's new Blocks editor? Adding a new block always puts it outside of the list block, rather than inside the current list item, as I want.

1 Answers

Unfortunately, the WP Core List Block does not allow inner blocks. It can only contain text. You can force it to allow line breaks by pressing "shift + enter" between paragraphs, but that just adds a <br> tag and not even a separate paragraph. They simply didn't code lists to contain anything other than <li>s and <br>s.

It wouldn't be surprising if someone has created a third-party list block that can contain Inner Blocks, so you might try searching for a plugin for now, and perhaps raising an issue on GitHub requesting this feature. (I didn't see any issues/requests at first glance but there may already be one.)

Related