Repository navigation
Fix misplaced anchors for remark and proof-like divs - #79
d-morrison wants to merge 1 commit into
Conversation
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
|
Claude finished review — View run Upstream didn't bump the version either, so this PR is consistent with that precedent — not a concern. I've completed a thorough review: read the full diff, inspected the complete resulting files, confirmed this is a byte-for-byte port of the already-merged upstream fix ( FindingsNo bugs found in the ported JS/Lua logic — verified by direct execution, not just reading. No CLAUDE.md violations: the change is tightly scoped to the two files it touches, doesn't reformat unrelated code, isn't R (so One minor, non-blocking observation: there are currently no VerdictReady for merge Structured Review Data (JSON){
"schema_version": "1.1",
"reviewer": "claude",
"commit_sha": "3d48f48d8c851803b326e922b4cb12672dbb160e",
"verdict": "CLEAN",
"findings": [],
"detailed_assessment": "Executed the patched div-anchors.js in a jsdom harness across nested-element, flat-text, no-sibling, id-prefix-only, and theorem-title regression cases; anchor relocation and whitespace trimming behaved correctly in every scenario with no logic defects found.",
"holistic_assessment": "Change is a scoped, byte-identical port of the already-merged Morrison-Lab/qwt#160 fix, touches only the two intended extension files, introduces no regression to existing theorem-title handling, and needs no test infrastructure beyond what already exists for this vendored extension."
}Reviewed commit: 400258b |
|
Port div-anchors extension fix from Morrison-Lab/qwt#160 (Morrison-Lab/qwt#159).
Problem
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.jsonly queried.theorem-titlewhen 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.Solution
.proof-titlealongside.theorem-titleindiv-anchors.js.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 trailing space separates the anchor from subsequent body content if not already spaced.remandsolaliases and crossref ID prefix matching (rem-,thm-,def-, etc.) tois_theorem_divin both Lua and JS.