[wp-trac] Re: [WordPress Trac] #1024: wp filters turn < hr /> into < hr /> < br />

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 14 15:15:32 GMT 2006


#1024: wp filters turn <hr /> into <hr /><br />
-----------------------------+----------------------------------------------
 Reporter:  anonymousbugger  |        Owner:  filosofo
     Type:  defect           |       Status:  new     
 Priority:  normal           |    Milestone:  2.1     
Component:  Administration   |      Version:  2.1     
 Severity:  minor            |   Resolution:          
 Keywords:  bg|has-patch     |  
-----------------------------+----------------------------------------------
Comment (by Dreamseer):

 There has to be changed even more, to handle additional forms in posts or
 pages which use
 {{{
 <fieldset>
 }}}
 or
 {{{
 <legend>
 }}}

 Unfortunately this is my first post to WordPress Trac, so I don't know how
 to change WordPress code. Maybe someone can change these lines in function
 wpautop():

 {{{
         $pee =
 preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!',
 "$1", $pee);
         $pee =
 preg_replace('!(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!',
 "$1", $pee);
         if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n",
 $pee); // optionally make line breaks
         $pee =
 preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br
 />!', "$1", $pee);
 }}}

 to

 {{{
         $pee =
 preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|fieldset|legend|blockquote|address|math|p|h[1-6])[^>]*>)!',
 "$1", $pee);
         $pee =
 preg_replace('!(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|fieldset|legend|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!',
 "$1", $pee);
         if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n",
 $pee); // optionally make line breaks
         $pee =
 preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|fieldset|legend|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br
 />!', "$1", $pee);
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/1024>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list