Repository navigation
Fix misplaced anchors for remark and proof-like divs - #160
Conversation
Quarto theorem environments render titles with class .theorem-title, while proof-like environments (proof, remark, solution) render titles with class .proof-title. Previously, div-anchors.js only queried .theorem-title when relocating AnchorJS anchor links inline, causing remark and other proof-like divs to leave the anchor link at the bottom of the div rather than next to the title. - Support .proof-title alongside .theorem-title in div-anchors.js - Trim trailing whitespace from .proof-title (which ends with '. ') so the non-breaking separator and anchor stay attached to the title, and ensure a space separates the anchor from subsequent body content - Add 'rem' and 'sol' aliases and crossref ID prefix matching (rem-, thm-, def-, etc.) to is_theorem_div in both Lua and JS
|
Claude finished review — View run Review: PR #160 — Fix misplaced anchors for remark and proof-like divsScope: Only Verification performedI don't have
Observations (non-blocking)
CLAUDE.md / lab-manual complianceNo R, I found no correctness bugs, no CLAUDE.md violations, and no hallucinated APIs/symbols — VerdictReady for merge — no blocking findings; one non-blocking observation about unverified necessity of the ID-prefix fallback (not a correctness issue, just an open question for the author's own confidence). Structured Review Data (JSON){
"schema_version": "1.1",
"reviewer": "claude",
"commit_sha": "71bb81772d081b9d2bf725d44b3d6ce9a681201d",
"verdict": "CLEAN",
"findings": [],
"detailed_assessment": "Reconstructed quarto-cli's real proof-title DOM shape in a jsdom harness and confirmed the trim-and-reinsert logic in div-anchors.js correctly places the anchor inline without breaking the pre-existing theorem-title path.",
"holistic_assessment": "Scope stays limited to the two div-anchors extension files for issue 159, parity between the JS and Lua class/prefix lists is maintained, and no regression risk was found for downstream template consumers."
}Reviewed commit: 71bb817 |
|
Done with my local session — unclaiming. Posted by Antigravity (AI agent) --- not written by a human. |
|
Port div-anchors extension fix from Morrison-Lab/qwt#160 (Morrison-Lab/qwt#159). Quarto theorem environments render titles with class .theorem-title, while proof-like environments (proof, remark, solution) render titles with class .proof-title. Previously, div-anchors.js only queried .theorem-title when relocating AnchorJS anchor links inline, causing remark and other proof-like divs to leave the anchor link at the bottom of the div rather than next to the title. - Support .proof-title alongside .theorem-title in div-anchors.js - Trim trailing whitespace from .proof-title (which ends with '. ') so the non-breaking separator and anchor stay attached to the title, and ensure a space separates the anchor from subsequent body content - Add 'rem' and 'sol' aliases and crossref ID prefix matching (rem-, thm-, def-, etc.) to is_theorem_div in both Lua and JS Co-authored-by: morri313 <morri313@cf463-02.cs.wwu.edu>
Port div-anchors extension fix from Morrison-Lab/qwt#160 (Morrison-Lab/qwt#159). Quarto theorem environments render titles with class .theorem-title, while proof-like environments (proof, remark, solution) render titles with class .proof-title. Previously, div-anchors.js only queried .theorem-title when relocating AnchorJS anchor links inline, causing remark and other proof-like divs to leave the anchor link at the bottom of the div rather than next to the title. - Support .proof-title alongside .theorem-title in div-anchors.js - Trim trailing whitespace from .proof-title (which ends with '. ') so the non-breaking separator and anchor stay attached to the title, and ensure a space separates the anchor from subsequent body content - Add 'rem' and 'sol' aliases and crossref ID prefix matching (rem-, thm-, def-, etc.) to is_theorem_div in both Lua and JS Co-authored-by: morri313 <morri313@cf463-02.cs.wwu.edu>
Closes #159
Summary
In Quarto, theorem environments render their headings with
.theorem-titlewhile proof-like environments (proof,remark,solution) render their headings with.proof-title. Previously,div-anchors.jsonly queried.theorem-titlewhen moving AnchorJS anchor links inline, causing remark and other proof-like divs to leave the anchor link at the bottom of the div rather than beside the heading.Changes
moveTheoremDivAnchorsInlineto select.theorem-title, .proof-title.". "inside.proof-titleand immediately follows with the body text without leading whitespace. We trim trailing whitespace from the title's last text node before appending the non-breaking space separator (\u00A0) and anchor link, and ensure a trailing space separates the anchor from subsequent body content."rem"and"sol"aliases totheorem_div_classesandtheoremLikeClasses.rem-,sol-,thm-, etc.) tois_theorem_divin bothdiv-anchors.luaanddiv-anchors.js.Verification
chapters/theorem-examples.qmdto HTML.rem-convergenceandsol-integrationare placed directly inline after the heading inside.proof-title, with no misplaced link at the bottom of the div.thm-mean-value,def-derivative, etc.) continue to render correctly with inline anchors.devtools::check(),lintr::lint_dir(), and package spellcheck — all passed cleanly.