Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#13658 closed defect (bug) (invalid)

Extra Paragraph Close Tags Added for Blank Lines

Reported by: cmarshall's profile cmarshall Owned by:
Milestone: Priority: low
Severity: normal Version:
Component: General Keywords: paragraph tag closing
Focuses: Cc:


This does not appear to be caused by a plugin or filter.

Blank lines in the text entry for pages and posts results in singular (unmatched) </p> tags.

This makes validators cry. It may cause problems for slobs.

I tried searching for the same bug report, but I got so many hits of unrelated information that I gave up. I apologize if this is a repeat.

Change History (6)

#1 @nacin
14 years ago

Could you provide some sample text? Surround it in {{{ !}}} tags.

#2 @nacin
14 years ago

(Excluding the !)

#3 @cmarshall
14 years ago

Sure. The page in question is this one:

The exact source is this:


<p class="first">This is the index, or "Home" page for the entire site. The row of "tabs" along the top of this page will take you to the "Home Page" for each individual sub section. The logo in the upper left corner will always return you to this page.</p>
<div style="text-align:center;font-weight:bold;margin-top:8px">Search For An NA Meeting</div>

I get an extra </p> under each of the forms.

#4 @nacin
14 years ago

This appears to be a plugin; I imagine those HTML comments are being parsed by a plugin and then markup is getting added?

Please try the support forums:

#5 @cmarshall
14 years ago

I'll check.

Since I'm the author of the three plugins, I can tell you that I don't add any {{</p}} tags.

I think it has something to do with the forms (note that it doesn't happen after LIST_POSTS, which may indeed, include paragraphs, but doesn't have any forms, unless there's a password-protected post).

{{<sigh/>}} I'll add a filter to yank them out. Just figgered I'd let you guys know....

#6 @azaozz
14 years ago

  • Milestone Unassigned deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 3.0 deleted

@cmarshall this is how the HTML Editor in WordPress works in conjunction with wpautop. If you are replacing/inserting content before the wpautop filter, make sure there aren't any line breaks \r\n|\n in it as autop would try to convert them to paragraphs.

Line breaks don't make any difference in HTML but are used by autop to separate paragraphs.

Note: See TracTickets for help on using tickets.