w3c / specberus

Checker used at W3C to validate the compliance of Technical Reports with publication rules
https://www.w3.org/pubrules/
MIT License
77 stars 46 forks source link

Support h1 with span #1146

Closed xfq closed 3 years ago

xfq commented 3 years ago

The h1 of clreq contains a span, but it cannot be published because of the title element and the h1 element are not the same. (There is also a br in the h1, but that is another issue.)

We did not include span in title because title does not support span elements. (See HTML issue.)

The span was added in https://github.com/w3c/clreq/commit/3b8671e166b80f06cd3596d402ab2388ac0340af

Related code in specberus: https://github.com/w3c/specberus/blob/main/lib/rules/headers/h1-title.js

(See also https://github.com/w3c/clreq/issues/72 for background.)

/cc @r12a

/cc @himorin (because jlreq may have the same issue)

r12a commented 3 years ago

I thought that @marcoscaceres fixed this some time ago so that the h1 and title elements could have different text. If the span is used only in the h1 and there is a title element also, then it should work, no?

jennyliang220 commented 3 years ago

@r12a Sadly pubrules is currently not smart enough to ignore <span> or other HTML elements: https://github.com/w3c/specberus/blob/main/lib/rules/headers/h1-title.js#L17-L20

it'll be fixed in #1147