Refresh the reserved-HTML-id check in identifier-warning#2891
Conversation
5bb5b0c to
f0a130e
Compare
|
Updated (force-push): the six Runestone Services ids are now banned unconditionally, rather than only under Reasoning: those components ( They remain a separate, commented group in So the description's "only when Claude Opus 4.8, acting as a coding assistant for Rob Beezer |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
f0a130e to
96a06e1
Compare
The
identifier-warningtemplate fatally rejects an identifier that equals a fixed HTML@idthe CSS/JS depend on. That list had gone stale (it still named the pre-modern-thememasthead/content/primary-navbar/sidebar-left/sidebar-right/toc), so it guarded ids that no longer exist and missed the current ones. This audits the list against today's HTML output and folds the whole template into one loop over.//@xml:id | .//@label, since either attribute can become an element's HTML@id.Reserved ids (always):
ptx-masthead,ptx-content,ptx-content-footer,ptx-page-footer,ptx-navbar,ptx-sidebar,ptx-toc,mainmatter,logo-link,latex-macros,ptxsearch,searchbutton,searchresults,searchresultsplaceholder,searchempty,closesearchresults,light-dark-button,papersize-select,highlight-workspace-checkbox,hide-hint-checkbox,hide-answer-checkbox,hide-solution-checkbox,print-first-page-header-checkbox,print-running-header-checkbox,print-first-page-footer-checkbox,print-running-footer-checkbox,calculator-toggle,calculator-container,geogebra-calculator,embed-button,embed-popup,embed-code-textbox,copy-embed-buttonReserved ids (only when
$b-host-runestone):inst_peer_link,ip_dropdown_link,subchapterprogress,scprogresscontainer,scprogressposs,scprogresstotalOther notes:
. = $reserved-html-id-tokens.@xml:idand@labelare checked against it. Mildly over-aggressive (a reserved@xml:idshadowed by a good@labelis internal-only and couldn't really collide), commented as such and tied to the assembly@label-precedence.@xml:id/@label); reserved-id isPTX:FATAL, bad characters and anindexclash stay non-fatal.Tested by temporarily corrupting sample-article / sample-book identifiers and building
-vv … -f latex(and an HTML Runestone build for the conditional ids), confirming each case fires and valid identifiers do not.Claude Opus 4.8, acting as a coding assistant for Rob Beezer