Repository navigation
Fix misplaced anchors for remark and proof-like divs - #73
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 Good — the upstream qwt#160 fix was merged just minutes before this port PR was opened. Everything checks out: the port is byte-identical to the merged, verified upstream fix, the ID-prefix conventions it adds ( No CLAUDE.md, lab-manual, or correctness issues found. This is a pure extension (JS/Lua) change with no VerdictReady for merge — faithful, verified port of the upstream Structured Review Data (JSON){
"schema_version": "1.1",
"reviewer": "claude",
"commit_sha": "a5e284e27b4061ce2674c6d45a98b5400daed550",
"verdict": "CLEAN",
"findings": [],
"detailed_assessment": "Checked div-anchors.js and div-anchors.lua whitespace-trim and prefix-matching logic against real repo content like _sol-loss.qmd and found no failure mode.",
"holistic_assessment": "Confirmed this port matches the merged upstream qwt#160 fix byte-for-byte, so integration, scope, and regression risk are all minimal."
}Reviewed commit: a5e284e |
|
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.