Make WordPress Core

Changes between Initial Version and Version 7 of Ticket #29643


Ignore:
Timestamp:
07/05/2021 05:13:00 PM (5 years ago)
Author:
sabernhardt
Comment:

Using the Classic block, I was able to return to visual editor and publish like this:

<ol>
<li>Ordered list item 1</li>
Block of text inserted into list but not inside an li tag.
<li>Ordered list item 2</li>
<li>Ordered list item 3</li>
<li>Ordered list item 4</li>
</ol>

But then I reopened the post editor and it had changed to this:

<ol>
<li style="list-style-type: none;">
<ol>
<li>Ordered list item 1</li>
</ol>
</li>
</ol>
<p>Block of text inserted into list but not inside an li tag.</p>
<ol>
<li>Ordered list item 2</li>
<li>Ordered list item 3</li>
<li>Ordered list item 4</li>
</ol>

Similarly in Classic Editor, I can publish from Text view without any markup changes, but I get the nested list when switching to Visual editor before publishing the post:

<ol>
 	<li style="list-style-type: none;">
<ol>
 	<li>Ordered list item 1</li>
</ol>
</li>
</ol>
Block of text inserted into list but not inside an li tag.
<ol>
 	<li>Ordered list item 2</li>
 	<li>Ordered list item 3</li>
 	<li>Ordered list item 4</li>
</ol>

Adding a comment inside the list results in nesting a list inside an li tag as well (after publish in block editor/after Visual switch in Classic), with the comment after the list. It also can get messier in the Classic Editor if you switch between Visual and Text views multiple times.

So when the editor reformats, it produces valid list markup now, except the result is not what was intended.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29643

    • Property Milestone changed from to Awaiting Review
  • Ticket #29643 – Description

    initial v7  
    99Here's the code from the HTML editor BEFORE I switched back to the Visual Editor:
    1010
     11{{{
    1112<ol>
    1213        <li>Ordered list item 1</li>
     
    1617        <li>Ordered list item 4</li>
    1718</ol>
     19}}}
    1820
    1921Here's the code after switching to the Visual Editor and then back to the HTML editor:
    2022
     23{{{
    2124<ol>
    2225<ol>
     
    3033        <li>Ordered list item 4</li>
    3134</ol>
     35}}}