[wp-trac] [WordPress Trac] #20444: wpautop acts on a single line of text
WordPress Trac
wp-trac at lists.automattic.com
Sun Apr 15 03:02:06 UTC 2012
#20444: wpautop acts on a single line of text
--------------------------+-----------------------------
Reporter: niallkennedy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20444>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list