Closed (fixed)
Project:
#Heading
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Dec 2012 at 08:33 UTC
Updated:
15 Jan 2013 at 22:20 UTC
The regular expression is /<h([1-6])>(.*?)<\/h[1-6]>/. This is extremely specific to heading tags that use a lower case "h" and have no attributes. Furthermore, the substitution callback has no way to deal with existing attributes even if the regex could deal with it.
There are two paths forward:
Case insensitive, ungreedily match on anything within the first heading tag as long as there's at least one space after the number.
Check out drupal_xml_parser_create() and format_xml_elements() as potential starting position.
Comments
Comment #1
Grayside commentedhttp://drupalcode.org/sandbox/grayside/1876908.git/commit/8cb92e1
#1877306: Not friendly to mobile or keyboard-only navigation moved all the necessary HTML additions to new tags nested inside the header element itself. As a result, some tweaking to the regular expression is a light-weight and sufficient-for-now solution.
Comment #2
Grayside commentedhttp://drupalcode.org/sandbox/grayside/1876908.git/commit/0e39619
Small tweak.
Comment #3.0
(not verified) commentedAdd notes about next steps for fix.