Opened 17 years ago
Closed 16 years ago
#8644 closed defect (bug) (fixed)
wpautop breaks <fieldset> and <legend> markup
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.7 |
Component: | Formatting | Keywords: | needs-patch |
Focuses: | Cc: |
Description
I use the fieldset (and legend) tag in my posts. These tags aren't parsed correctly by Wordpress and produces invalid XHTML. I'm not sure if it's correct, but this is how I fixed it:
formatting.php
Line 120; add fieldset and legend:
$allblocks = '(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|fieldset|legend|address|math|style|input|p|h[1-6]|hr)';
Add the following line, e.g. below line 139:
$pee = str_replace('</fieldset>', '</p></fieldset>', $pee);
Attachments (2)
Change History (14)
#1
@
16 years ago
- Keywords has-patch wpautop added
- Owner changed from anonymous to Sam_a
- Status changed from new to assigned
- Summary changed from Include <fieldset> and <legend> in formatting.php to wpautop should recognize <fieldset> and <legend> as block elements
- Type changed from enhancement to defect (bug)
- Version set to 2.7
#2
@
16 years ago
- Summary changed from wpautop should recognize <fieldset> and <legend> as block elements to wpautop breaks <fieldset> and <legend> markup
Patch stops wpautop from wrapping fieldset
and legend
in paragraph tags.
But I still see invalid markup when text inside the fieldset
has less than 2 newlines above and below it; wpautop inserts <p>
but omits </p>
:
<?php echo wpautop("<fieldset><legend>Legend</legend>Text inside fieldset</fieldset>"); ?>
<fieldset> <legend>Legend</legend> <p>Text inside fieldset</fieldset>
#5
@
16 years ago
- Keywords needs-patch added; has-patch removed
- Milestone 2.8 deleted
patch is broken, but easy enough to fix. js patch is needed also
#9
@
16 years ago
- Keywords has-patch tested added; needs-patch removed
- Owner set to Sam_a
- Status changed from new to accepted
Attached patch autop_fieldset_legend.diff seems to fix the problem in trunk.
Note: See
TracTickets for help on using
tickets.
Adds FIELDSET and LEGEND to wpautop's list of HTML block elements