Skip to content

Commit

Permalink
Drop the “nested dfn or span in heading” error
Browse files Browse the repository at this point in the history
This change drops an error that Wattsi emits for the case where a
heading has an empty span or dfn (that is, with no text content),
followed by another span or dfn in the same heading.

The current code appears to have been (for some reason that’s not
obvious now) very intentionally written to report an error for exactly
that case — but not for the case where of a heading with *non-empty*
span or dfn followed by another span or dfn in the same heading.

Without this change, Wattsi reports an error for a reasonable markup case
like the one in whatwg/html#5855; that is, this:

<h5 id="rel-alternate"><span id="link-type-alternate"></span>Link type "<dfn data-export=""
data-dfn-for="link/rel,a/rel,area/rel" data-dfn-type="attr-value"><code
data-x="rel-alternate">alternate</code></dfn>"</h5>

It’s not at all obvious why we’d want a case like that to be an error.
  • Loading branch information
sideshowbarker committed Aug 29, 2020
1 parent 46f60c9 commit f2fd135
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/wattsi.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1286,8 +1286,6 @@ TCrossReferences = record
begin
if ((CandidateChild is TElement) and ((TElement(CandidateChild).IsIdentity(nsHTML, eDFN)) or (TElement(CandidateChild).IsIdentity(nsHTML, eSpan)))) then
begin
if (InSkippedNode) then
Fail('Nested <dfn> or <span> elements in heading ' + LastSeenHeadingID);
InSkippedNode := True;
if (CandidateChild.HasChildNodes()) then
begin
Expand Down

0 comments on commit f2fd135

Please sign in to comment.