The line break filter in Drupal needs to be aware of all the block level html elements for it's current implementation to work. The function starts out by defining these:

function _filter_autop($text) {
  // All block level tags
  $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)';

You'll notice the html5 block level elements (e.g., section) are not included in this list. That means the link break filter (to inject p and br tags) will fail around these. We either need to add them to this list or develop an implementation that doesn't require these.

CommentFileSizeAuthor
#2 filter-autop-1280522-2.patch819 bytesdcmouyard
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jacine’s picture

Issue tags: +Novice, +D8H5

Nice catch @mfer! I knew there was another filter-related issue somewhere. ;) I added this to the roadmap. I think we should just keep it simple and add the new block-level elements to this line, because that's what pretty much what we ended up doing for filter_xss_admin().

Tagging this as a Novice patch as the following elements just need to be added to that line:
article|aside|details|figcaption|figure|footer|header|hgroup|menu|nav|section|summary

dcmouyard’s picture

Status: Active » Needs review
FileSize
819 bytes

Here's a patch.

Status: Needs review » Needs work
Issue tags: -Novice, -html5, -D8H5

The last submitted patch, filter-autop-1280522-2.patch, failed testing.

iflista’s picture

Status: Needs work » Needs review

#2: filter-autop-1280522-2.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, filter-autop-1280522-2.patch, failed testing.

mfer’s picture

Status: Needs work » Needs review
Issue tags: +Novice, +html5, +D8H5

#2: filter-autop-1280522-2.patch queued for re-testing.

Jacine’s picture

Status: Needs review » Reviewed & tested by the community

Ok great, it was a testbot glitch and it's green now!

I just tested it and think it's good to go. Thanks again for the patch @dcmouyard!

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks!

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