wpautop breaking blank pages and some plugins
|Reported by:||DD32||Owned by:||anonymous|
2 issues i'm proposing a patch for:
- Blank pages contain a single '</p>' instead of a full paragraph: '<p></p>'
- Extra </p> tags are inserted before certain block elements where they shouldnt be placed.
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.
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.