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).

CommentFileSizeAuthor
#5 hr_block-D5.patch928 bytesalexanderpas
filter.module.patch911 byteswrwrwr
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexanderpas’s picture

Version: 5.6 » 6.0-rc2
Status: Needs review » Reviewed & tested by the community

Confirming this bug, also in 6.0-rc2

code seems correct.

HR should be considered a block level element.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Damien Tournoud’s picture

Version: 6.0-rc2 » 5.x-dev
Status: Closed (fixed) » Patch (to be ported)

Apparently this is an issue on 5.x too.

alexanderpas’s picture

Status: Patch (to be ported) » Needs review
FileSize
928 bytes

ported to D5 ;)

Damien Tournoud’s picture

Status: Needs review » Reviewed & tested by the community

Straightforward port, thanks @alexanderpas.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.