Make WordPress Core

Opened 8 years ago

Last modified 3 days ago

#5250 reopened defect (bug)

wpautop() issue with lists

Reported by: Narc0tiq Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.3
Component: Formatting Keywords: needs-patch needs-unit-tests wpautop
Focuses: Cc:

Description (last modified by johnbillion)

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>more text</li>

This was automatically converted to:

  </ul><p>more text</li>

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><p>more text</p></li>

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

Change History (14)

comment:1 @Narc0tiq8 years ago

  • Milestone 2.5 deleted

comment:2 @Otto428 years ago

  • Keywords autop added
  • Milestone set to 2.4
  • Priority changed from low to normal
  • Severity changed from trivial to normal

comment:3 @Viper007Bond8 years ago

Another work around is just to add in some line breaks:

	<li>Some text!
			<li>More text!</li>

comment:4 @Viper007Bond8 years ago

  • Keywords needs-patch added; xhtml autop removed
  • Summary changed from Unclosed p tags -- not XHTML-compliant! to wpautop() issue with nested lists

I take that back. I forgot the text after the first </ul> and even with more line breaks, it added in a <p>. My apologies.

comment:5 @foolswisdom8 years ago

  • Keywords xhtml autop added

comment:6 @darkdragon8 years ago

  • Component changed from General to Template

comment:7 @Denis-de-Bernardy6 years ago

  • Component changed from Template to Formatting

comment:8 @azaozz6 years ago

  • Milestone changed from 2.9 to Future Release

comment:9 @Jani Uusitalo4 years ago

  • Summary changed from wpautop() issue with nested lists to wpautop() issue with lists

This looks related to a test case I was preparing to demonstrate how flawed the output from wpautop can get inside lists:



renders as:


whereas I'd expect it to be


I'm changing the summary to generally cover wpautop's problems within <li> elements.

comment:10 @Jani Uusitalo4 years ago

  • Cc Jani Uusitalo added

comment:11 @nacin21 months ago

  • Keywords wpautop added; autop removed

comment:12 @chriscct75 days ago

  • Keywords needs-unit-tests added; xhtml wpautop removed
  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Closing as wontfix. Complete lack of interest on the ticket over the last 4 years. Feel free to reopen when more interest re-emerges (particularly if there's a patch)

comment:13 @johnbillion4 days ago

  • Description modified (diff)

comment:14 @miqrogroove3 days ago

  • Keywords wpautop added
  • Milestone set to Future Release
  • Resolution wontfix deleted
  • Status changed from closed to reopened
Note: See TracTickets for help on using tickets.