Make WordPress Core

Opened 17 years ago

Closed 16 years ago

#3935 closed defect (bug) (wontfix)

wpautop breaking blank pages and some plugins

Reported by: dd32's profile DD32 Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2
Component: Template Keywords: has-patch needs-testing
Focuses: Cc:


2 issues i'm proposing a patch for:

  1. Blank pages contain a single '</p>' instead of a full paragraph: '<p></p>'
  2. Extra </p> tags are inserted before certain block elements where they shouldnt be placed.

Issue 1:
Create a completely blank post, View the source of the page, it'll be similar to this:

<h1>Test Heading</h1>

The Paragraph is never opened, Of course if there is any non-space characters in a page, this issue doesnt exist. But it also affects plugins which use pages to dsplay their content.

Issue 2:
When using plugins such as WP-ContactForm: Akismet Edition which hook the_content, the output is converted to this:

<input type="hidden" name="wpcf_stage" value="process" /></div>

Both of those </p> elements shouldnt be there.

Both of these issues make blank posts, or certain content plugins fail XHTML Validation, making the page unviewable when using html_type set to application/xhtml+xml

Attached is a patch which fixes both of these rare cases.
There also doesnt seem to be any performance hit accroding to the profiler.

Attachments (1)

3935.wpautop-fix.patch (2.0 KB) - added by DD32 17 years ago.
wpautop patch

Download all attachments as: .zip

Change History (4)

17 years ago

wpautop patch

#1 @foolswisdom
17 years ago

  • Milestone changed from 2.2 to 2.3

#2 @Nazgul
17 years ago

  • Milestone changed from 2.3 to 2.4

#3 @DD32
16 years ago

  • Milestone 2.6 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Theres been no traction over the past year.

The Blank post no longer occurs, However eronous </p>'s are still being added before block level elements such as </form> and </div>

Note: See TracTickets for help on using tickets.