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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | filter-autop-1280522-2.patch | 819 bytes | dcmouyard |
Comments
Comment #1
jacineNice 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|summaryComment #2
dcmouyard commentedHere's a patch.
Comment #4
iflista commented#2: filter-autop-1280522-2.patch queued for re-testing.
Comment #6
mfer commented#2: filter-autop-1280522-2.patch queued for re-testing.
Comment #7
jacineOk 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!
Comment #8
dries commentedCommitted to 8.x. Thanks!