wpautop acts on a single line of text
|Reported by:||niallkennedy||Owned by:|
HTML markup on a single line wrapped in a block element is interpreted and changed by wpautop. The wpautop function is described as replacing "double line-breaks with paragraph elements" which led me to expect the single line would not become many lines.
echo wpautop( '<div><p>Hello world</p><span>WordPress</span></div>' );
<div> <p>Hello world</p> <p><span>WordPress</span></div>
Extra <p> before the <span>.
I expected wpautop would find no newlines and return the original string.
The same string placed inside a HTML5 or XHTML 1 Strict document <body> is parsed as valid by W3C Validator.
Plugins acting on the_content with a priority less than 10 may have their single-line markup reinterpreted by wpautop.