Skip to content

check_pages.py: flag control characters inside a line, duplicated references, rows and bullets (E5-E7, W4) - #365

Merged
teorth merged 1 commit into
teorth:mainfrom
maximusrufus:check-pages-damage
Nov 22, 2026
Merged

teorth merged 1 commit into
teorth:mainfrom
maximusrufus:check-pages-damage

Conversation

@maximusrufus

Copy link
Copy Markdown
Contributor

Adds four checks to scripts/check_pages.py for damage a merge or a script can leave in a constant page:

  • E5 a control character inside a line. The page is read without newline translation, since universal newlines turn a stray carriage return into a line break and hide it. This is how \rvert or \approx ends up as a carriage return or a bell.
  • E6 a reference key defined twice under ## References.
  • E7 a table row repeated with the same reference and the same description.
  • W4 a bold bullet heading (- **Name.**) repeated within one section.

E6, E7 and W4 catch a branch that is merged after its page has moved on and brings back old lines.

Run over every version of every page in the repository (836 commits), the new checks report 9 distinct lines, all real: seven on constants/1d.md, one on constants/47a.md, and one earlier \rvert in 3a that has since been fixed. On the current main they report constants/1d.md (#362) and constants/47a.md (two \approx, fixed in a separate PR). Nothing else in the repository is flagged. Until those two fixes merge, the script exits 1 on main (E5-E7 are errors).

50 added lines, standard library only; existing checks unchanged.

teorth added a commit that referenced this pull request Nov 22, 2026
47a.md had "\approx" twice with the backslash-a eaten into a BEL (0x07),
and README.md had "\times" with the backslash-t eaten into a TAB (0x09),
both mid-line. Each came from a Python heredoc in bash interpreting the
escape before Python saw it -- the same hazard that split the C_3a row
across three lines in October.

#363 had already spotted the 47a pair, and #365 proposes adding a
control-character rule to check_pages.py, which would have caught both.
A sweep of README, CONTRIBUTING, template and all constant pages finds no
others; the ~1000 other tabs are the leading indentation of nested
reference entries, which is the house style.

Co-Authored-By: Claude Opus 5 <[email protected]>
@teorth
teorth merged commit 236d60d into teorth:main Nov 22, 2026
teorth added a commit that referenced this pull request Nov 22, 2026
Repairs 1d.md damage my conflict resolver introduced in October: it keeps
both sides of every hunk, which is right for the Recent progress tail but
duplicated the CERT2026 row, its reference and three bullets, and a
\rvert had become a carriage return. Found by the E5-E7 and W4 checks from
#365, merged minutes earlier.

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants