Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spec/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ def undeclared_h2_headings(text, declared):
then holds for any caller, regardless of how its own names are cased or spaced.
Scoped to `## ` only, the section model's unit. An H1 title or a nested H3 is not itself a
section this check judges.
Fence-aware via unfenced_text. A `## ` line inside a fenced code sample, or a `##`-prefixed
shell comment, is not misread as a real heading.
Fence-aware via unfenced_text. Either a heading-syntax line or a `##`-prefixed shell comment, shown
inside a fenced code sample, is not misread as a real heading.
"""
h2s = {ln[3:].strip().lower() for ln in unfenced_text(text).split("\n") if ln.startswith("## ")}
return sorted(h2s - {d.strip().lower() for d in declared})
Expand Down