id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 43387,"wpautop() adds ""

"" where it should not",1994rstefan,,"There are a few cases where `wpautop()` creates invalid HTML code by inserting just a closing p tag. (Opening tag is missing) The problem exists with all block elements (defined inside wpautop function) {{{#!php $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; }}} I have found two cases where this happens but there may be more. Minimal Examples: {{{#!php echo wpautop('
X
'); echo PHP_EOL; echo wpautop('
'); // note the space in front of the tag }}} Output: {{{
X

}}} The problem is relevant because `wpautop` is used to filter `the_content()`. Examples what the user could insert inside the backend editor which results in this error: {{{

Heading
Subheading

just an example
}}} ",defect (bug),closed,normal,,Formatting,3.0,normal,duplicate,,,