[wp-trac] Re: [WordPress Trac] #2813: wpautop() adding eroniuous <br/> tags

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 20 17:31:13 GMT 2007


#2813: wpautop() adding eroniuous <br/> tags
---------------------+------------------------------------------------------
 Reporter:  pidge    |        Owner:  pishmishy
     Type:  defect   |       Status:  assigned 
 Priority:  normal   |    Milestone:  2.4      
Component:  General  |      Version:  2.0.3    
 Severity:  normal   |   Resolution:           
 Keywords:  <br>     |  
---------------------+------------------------------------------------------
Changes (by pishmishy):

  * keywords:  xml-rpc, <br> => <br>
  * owner:  anonymous => pishmishy
  * status:  new => assigned
  * component:  XML-RPC => General
  * summary:  Extra <br /> tags added when posted via xml-rpc => wpautop()
              adding eroniuous <br/> tags

Comment:

 Problem is located in lines 81-85 of formatting.php (at least it
 disappears when you comment these lines out)

 {{{
 if ($br) {
                $pee = preg_replace('/<(script|style).*?<\/\\1>/se',
 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee);
                $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n",
 $pee); // optionally make line breaks
                $pee = str_replace('<WPPreserveNewline />', "\n", $pee);
         }
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/2813#comment:9>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list