[wp-trac] [WordPress Trac] #7937: Problem with the wpautop function ads a extra <p> tag if there is more span tag

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 7 03:56:20 UTC 2012


#7937: Problem with the wpautop function ads a extra <p> tag if there is more span
tag
--------------------------+------------------------
 Reporter:  keithdsouza   |       Owner:  anonymous
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Template      |     Version:  2.7
 Severity:  normal        |  Resolution:  invalid
 Keywords:  wpautop       |
--------------------------+------------------------
Changes (by WraithKenny):

 * keywords:   => wpautop


Comment:

 I know this ticket is over 3 years old but the comment struck me as
 extremely strange.

 It's a slightly absurd and extremely rare condition (likely never
 happened) for a theme to put the editors contents directly into a ''XHTML
 1.0-Strict'' document's `body` element on the theme-side (for this is the
 only circumstance that the snippet would be invalid). It'd seem to me in
 this (imaginary) case it'd be the theme's error and the theme should be
 considered invalid (as opposed to this ticket).

 If we'd consider the theme that dumps `the_content()` into the `body`
 element as invalid, that would suggest a shortcoming in the Content
 Editor's implementation: The fact that the output of `the_content()` maps
 to the content of the ''TinyMCE's'' `body` element (which is ''XHTML
 1.0-Strict'' and disallows inline elements as `body` children).

 ''<ASIDE>''When using Visual Mode, it'd be better to put a `div` element
 as a content wrapper (as a valid ''XHTML 1.0-Strict'' child of the `body`
 element and thus making child inline elements valid) and then removing it
 on save. This could allow the Visual Editor to contain a proper cascade of
 `body_class` (on the ''TinyMCE's'' `body`) and `post_class` (on this new
 temporary `div`) for `editor_style.css`.''</ASIDE>''

 There isn't any requirement that the Theme be ''XHTML 1.0-Strict''; Other
 doctypes allow inline elements as children of the body. The ''XHTML
 1.0-Strict'' limitation is merely a technical shortcoming of the Visual
 Editor. The Visual Edidor itself is optional and the Visual Editor isn't
 required to trigger this bug. The bug is, in fact, "entering invalid XHTML
 could produce unexpected results" and saying so is just a restatement and
 confirmation of the bug.

 Again, this just struck me as bazaar that it would be closed as "invalid"
 and blamed on user error.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/7937#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list