Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#5 | hr_block-D5.patch | 928 bytes | alexanderpas |
filter.module.patch | 911 bytes | wrwrwr | |
Comments
Comment #1
alexanderpas CreditAttribution: alexanderpas commentedConfirming this bug, also in 6.0-rc2
code seems correct.
HR should be considered a block level element.
Comment #2
Gábor HojtsyCommitted, thanks.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedApparently this is an issue on 5.x too.
Comment #5
alexanderpas CreditAttribution: alexanderpas commentedported to D5 ;)
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud commentedStraightforward port, thanks @alexanderpas.
Comment #7
drummCommitted to 5.x.