Using line breaking and <hr /> results in an invalid markup
wrwrwr - January 20, 2008 - 19:15
| Project: | Drupal |
| Version: | 5.x-dev |
| Component: | filter.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Line breaking filter does not treat hr as a block level element and encloses it in paragraph tags (if used with empty lines above and below). This is invalid in XHTML.
Attached patch adds the hr tag to a list of block elements in _filter_autop. Possibly some more tags should be added (fieldset?, center for html?), but the list doesn't correspond to any DTD, so it's hard to tell.
$block = '(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|p|h[1-6]|hr)';Patch is created against the head, but tested only on the 5.6 branch (code is the same).
| Attachment | Size |
|---|---|
| filter.module.patch | 911 bytes |

#1
Confirming this bug, also in 6.0-rc2
code seems correct.
HR should be considered a block level element.
#2
Committed, thanks.
#3
Automatically closed -- issue fixed for two weeks with no activity.
#4
Apparently this is an issue on 5.x too.
#5
ported to D5 ;)
#6
Straightforward port, thanks @alexanderpas.
#7
Committed to 5.x.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.