Skip HTML comments in ISO clause structure linter#101
Conversation
The clause linter treated Pandoc RawBlock(html) nodes — which represent HTML comments — as body content between headings, causing false positive violations. Now _is_html_comment_block() detects these blocks (including sourcepos Div wrappers) and excludes them from both the body_seen flag and the body_lines reported in violations. Adds 21 unit tests covering the helpers and check_file integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Logic looks correct and conservatively safe (the
|
The clause linter treated Pandoc RawBlock(html) nodes — which represent HTML comments — as body content between headings, causing false positive violations. Now _is_html_comment_block() detects these blocks (including sourcepos Div wrappers) and excludes them from the body_seen flag. Multi-line comment fragments (<!--, inner lines, -->) are stripped from violation body_lines by _strip_html_comment_lines(), which tracks in-comment state across source lines. Adds 24 unit tests covering the helpers and check_file integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts: # doc_build/iso_clause_lint.py # tests/test_iso_clause_lint.py
|
@asluk updated. |
|
tl;dr the rewrite addresses my earlier nit and it looks good to merge. Pulled the head (b09cab7) and verified locally:
The two-helper split reads well: This isn't gating #517 (that pin stays at c918081), so it can ride a later routine pin bump. If you consider it done, mind taking it out of draft so we can merge? |
The clause linter treated Pandoc RawBlock(html) nodes — which represent HTML comments — as body content between headings, causing false positive violations. Now _is_html_comment_block() detects these blocks (including sourcepos Div wrappers) and excludes them from both the body_seen flag and the body_lines reported in violations.
Attn @asluk - this covers my comment in https://github.com/aousd/core-spec-wg/pull/517