whatwg / html-build

Build scripts for https://github.com/whatwg/html
Other
62 stars 62 forks source link

Make .pre-process-tag-omission.pl handle headings that break across multiple lines #250

Closed sideshowbarker closed 3 years ago

sideshowbarker commented 3 years ago

This change makes the .pre-process-tag-omission.pl script work as expected in the case where a heading for an element section breaks across multiple lines.

Otherwise, without this change, the script fails for a case like this:

<h4 element data-lt="meta" id="the-meta-element">The <dfn id="meta"><code>meta</code></dfn>
element</h4>

...that is, a case where the element</h4> part isn’t on the same line as the <code>meta</code></dfn> part.

That problem causes the script to fail to add the Tag omission in text/html subsection to the meta element section.


Note that the .pre-process-tag-omission.pl script reads the spec source line-by-line, so there’s no easy way to just adjust the heading-checking regular expression to deal with headings the break across multiple lines.

sideshowbarker commented 3 years ago

As an alternative to this patch, I raised https://github.com/whatwg/html/pull/5930 to change the source.

I’d personally prefer we make that change to the source rather than this change to the script — because the meta element is actually the only element-section heading we currently have which breaks across lines. So it seems easier to edit the source to just unwrap that one case back to a single line — rather than further touching this script (which is obviously fragile, and touching it risks introduced other regressions).