#1024 closed defect (bug) (fixed)
wp filters turn <hr /> into <hr /><br />
Reported by: | anonymousbugger | Owned by: | shorty114 |
---|---|---|---|
Milestone: | 2.1 | Priority: | normal |
Severity: | minor | Version: | 2.1 |
Component: | Administration | Keywords: | bg|has-patch |
Focuses: | Cc: |
Description
blah
<hr />
<h1>blah</h1>
becomes:
blah
<hr /><br />
<h1>blah</h1>
-- denis _\@/_ semiologic.com
Attachments (2)
Change History (12)
#6
@
18 years ago
- Keywords bg|has-patch added
- Milestone set to 2.1
- Owner changed from anonymous to filosofo
- Version set to 2.1
I've attached a patch
#7
@
18 years ago
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);
#8
@
18 years ago
- Owner changed from filosofo to shorty114
- Status changed from new to assigned
Added patch which uses Dreamseer's patch.
Note: See
TracTickets for help on using
tickets.
should read:
blah
<hr />
<h1>blah</h1>
becomes:
blah
<hr /><br />
<h1>blah</h1>