Make WordPress Core

Opened 20 years ago

Closed 18 years ago

#3935 closed defect (bug) (wontfix)

wpautop breaking blank pages and some plugins

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

Description

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>
	</p>

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>
</p></form>
</p></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 20 years ago.
wpautop patch

Download all attachments as: .zip

Change History (4)

@DD32
20 years ago

wpautop patch

#1 @foolswisdom
20 years ago

  • Milestone 2.2 → 2.3

#2 @Nazgul
19 years ago

  • Milestone 2.3 → 2.4

#3 @DD32
18 years ago

  • Milestone 2.6
  • Resolution → wontfix
  • Status new → 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.