• I am having a completely repeatable problem trying to edit List Blocks in HTML. It happens with OL and UL blocks the same way. I am using the WP editor. The WP version is 6.2. I am not having the issue with other blocks.

    If I have a link block and select edit in HTML, it does display the HTML version. However it seems to be adding content, as per below. Further, if I click to another application (Word) I immediately see the dialog block:

    This block contains unexpected or invalid content. “Attempt Block Recovery”

    If I attempt the recovery, the block is restored.

    The same thing occurs whether or not I edit the code once I return to Edit Visually.

    I have taken a set of steps to see what is going on behind the scenes. Here is the HTML for 2 List Blocks, unordered and ordered, each with Item1, Item 2, Item 3 as their contents.

    HTML before doing anything (from Preview>view source): (extra empty lines removed)
    
    <ul>
    
    <li>item 1</li>
    
    <li>item 2</li>
    
    <li>item 3</li>
    
    </ul>
    
    <ol>
    
    <li>Item 1</li>
    
    <li>Item 2</li>
    
    <li>Item 3</li>
    
    </ol>
    
    Select Edit in HTML, first list.
    
    Shows in the WP editor:
    
    <ul><!-- wp:list-item -->
    
    <li>item 1</li>
    
    <!-- /wp:list-item -->
    
    <!-- wp:list-item -->
    
    <li>item 2</li>
    
    <!-- /wp:list-item -->
    
    <!-- wp:list-item -->
    
    <li>item 3</li>
    
    <!-- /wp:list-item --></ul>
    
    And generates the error announcement on my switching to Word:
    
    This block contains unexpected or invalid content.
    
    "Attempt Block Recovery"
    
    Save draft and preview. Preview looks correct. HTML source: (extra blank lines removed)Note that the comments are not there.
    
    <ul>
    
    <li>item 1</li>
    
    <li>item 2</li>
    
    <li>item 3</li>
    
    </ul>
    
    <ol>
    
    <li>Item 1</li>
    
    <li>Item 2</li>
    
    <li>Item 3</li>
    
    </ol>
    
    Used Attempt Block Recovery. Save. Preview. Looks the same. HTML (extra blank lines removed):
    
    <ul>
    
    <li>item 1</li>
    
    <li>item 2</li>
    
    <li>item 3</li>
    
    </ul>
    
    <ol>
    
    <li>Item 1</li>
    
    <li>Item 2</li>
    
    <li>Item 3</li>
    
    </ol>

    If there is additional information I can provide that would be helpful, please let me know. This looks like a WP bug to me. I have not tried changing themes or disabling plugins, since this seems particular to List Blocks.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t edit a List Block in HTML’ is closed to new replies.