[wp-trac] [WordPress Trac] #5250: wpautop() issue with lists

WordPress Trac noreply at wordpress.org
Sun Oct 4 10:56:38 UTC 2015


#5250: wpautop() issue with lists
------------------------------------------+----------------------
 Reporter:  Narc0tiq                      |       Owner:
     Type:  defect (bug)                  |      Status:  closed
 Priority:  normal                        |   Milestone:
Component:  Formatting                    |     Version:  2.3
 Severity:  normal                        |  Resolution:  wontfix
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+----------------------
Description changed by johnbillion:

Old description:

> First of all, my sincere apologies if this is a duplicate.
>

> The problem, in short: WordPress inserted a number of unclosed `<p>` tags
> into my post. It should either insert correctly closed tags, or none at
> all. I honestly would prefer the former.
>

> In detail: I had HTML code very similar to this:
>
> <ul>
>   <li>text<ul>
>     <li>subtext</li>
>   </ul>more text</li>
> </ul>
>

> This was automatically converted to:
>
> <ul>
>   <li>text<ul>
>     <li>subtext</li>
>   </ul><p>more text</li>
> </ul>
>
> Note the extra `<p>` tag in the above, which is unclosed (making the W3C
> validator choke on my website).
>
> Also note, I was not using the WYSIWYG editor (turning it off was the
> first thing I did), so it's unlikely to be due to that.
>

> As a workaround, manually inserting properly closed `<p>` tags works just
> fine:
>
> <ul>
>   <li>text<ul>
>     <li>subtext</li>
>   </ul><p>more text</p></li>
> </ul>
>
> Since this workaround exists, the bug is not very prioritary, but it
> should also (hopefully) be easy to fix.

New description:

 First of all, my sincere apologies if this is a duplicate.


 The problem, in short: WordPress inserted a number of unclosed `<p>` tags
 into my post. It should either insert correctly closed tags, or none at
 all. I honestly would prefer the former.

 In detail: I had HTML code very similar to this:

 {{{
 <ul>
   <li>text<ul>
     <li>subtext</li>
   </ul>more text</li>
 </ul>
 }}}

 This was automatically converted to:

 {{{
 <ul>
   <li>text<ul>
     <li>subtext</li>
   </ul><p>more text</li>
 </ul>
 }}}

 Note the extra `<p>` tag in the above, which is unclosed (making the W3C
 validator choke on my website).

 Also note, I was not using the WYSIWYG editor (turning it off was the
 first thing I did), so it's unlikely to be due to that.

 As a workaround, manually inserting properly closed `<p>` tags works just
 fine:

 {{{
 <ul>
   <li>text<ul>
     <li>subtext</li>
   </ul><p>more text</p></li>
 </ul>
 }}}

 Since this workaround exists, the bug is not very prioritary, but it
 should also (hopefully) be easy to fix.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/5250#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list