Skip to content

Pin default KaTeX and markmap-autoloader versions - #2736

Merged
chalin merged 10 commits into
google:mainfrom
chalin:chalin-m24-katex-markmap-pins-2026-0824
Aug 24, 2026
Merged

Pin default KaTeX and markmap-autoloader versions#2736
chalin merged 10 commits into
google:mainfrom
chalin:chalin-m24-katex-markmap-pins-2026-0824

Conversation

@chalin

@chalin chalin commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator
  • Fixes Pin the default KaTeX version instead of latest #2705
  • Fixes Pin the markmap-autoloader version instead of loading it unversioned #2706
  • Pins the default KaTeX and markmap-autoloader versions in theme/hugo.yaml (params.katex.version, params.markmap.version), mirroring the Mermaid pin (Mermaid: pin default version, drop latest #2704 + Mermaid: harden version pin (single home, floating-version warning, canary) #2711): fail-closed errorf when the param is unset (the fetch/emit flow is skipped entirely, Mermaid's shape), suppressible warnidf on floating versions, exact-version canary test, Renovate coverage.
  • Canary test: generalizes mermaid-version.test.mjs into script-version-pins.test.mjs, covering all three pins from one table. Adversarial review rounds hardened it beyond the Mermaid original: template comments are stripped, the version read is anchored as the whole template action, $version must be assigned exactly once, and every CDN-URL line must interpolate $version itself.
  • Docs: user-guide KaTeX/MarkMap version sections render the pins live; maintainer notes generalize the Mermaid-version section to all script pins (anchor #script-versions, with #mermaid-version kept as a legacy anchor); changelog and 0.17.0 blog post updated.
  • Pin choices: katex 0.18.4 and markmap-autoloader 0.18.12, the latest stable of each; both clear the 3-day Renovate age gate and have no OSV advisories.
  • Deviation from the Mermaid pattern: none in behavior; KaTeX's guard wraps the existing GetRemote self-hosting flow (assets remain build-time fetched and self-hosted, per the issue's exposure analysis).
  • Previews:

chalin added 3 commits August 24, 2026 12:19
KaTeX build-time assets and the markmap-autoloader page script now load
pinned versions from theme/hugo.yaml (params.katex.version,
params.markmap.version) instead of resolving `latest` / unversioned CDN
URLs. Same pattern as the Mermaid pin (google#2703): fail-closed errorf when
the param is unset, suppressible warnidf on floating versions, and an
exact-version canary test (mermaid-version.test.mjs generalized to
script-version-pins.test.mjs, covering all three pins).
- User guide: KaTeX and MarkMap version sections, rendered live from the
  theme params, with the floating-version suppression IDs.
- Maintainer notes: generalize the Mermaid-version section to all pinned
  script dependencies (anchor mermaid-version -> script-versions).
- Changelog + 0.17.0 blog post: cover all three pins.
- Renovate: extend the JSONata customManager to the katex and markmap
  params.
Keeps the pins' changelog coverage in the user-facing entry only, with
the maintainer entry limited to the config-home move; updates the
refcache and md-output golden for the new anchors and description.
@chalin chalin added this to the 0.17.0 milestone Aug 24, 2026
chalin added 6 commits August 24, 2026 12:27
- Canary: asserts $version is assigned exactly once and that every CDN
  URL line carries $version itself, closing the reassignment and
  printf-literal false-clean paths.
- katex.html and scripts.html: skip the fetch/emit flow entirely when
  the version param is unset (Mermaid's if-version shape), instead of
  erroring and then still building CDN URLs.
- Maintainer notes: keep the published #mermaid-version anchor.
- Strips Hugo template comments before matching, so an inert decoy
  comment can't satisfy the URL assertions.
- Anchors the version read at both ends of the template action, closing
  the appended-pipeline-stage (same-line or multiline default)
  false-clean paths.
- Blog: resolve-from phrasing replaces float; #script-pins ->
  #script-dep-pins (inbound refs updated).
- Changelog: one Other-changes entry covers all three pins.
- Maintainer notes: drop the never-released mermaid-version legacy
  anchor; single params.PACKAGE.version placeholder replaces the double
  package/param enumeration.
… test

- User guide: one 'Pinned script-dependency versions' section homes the
  rationale, override config (params.PACKAGE.version placeholder), and
  warning suppression; the three per-tool passages shrink to their
  current pin plus a link. Partials' warning URLs point at the shared
  section.
- Factors the markmap block out of scripts.html into
  scripts/markmap.html, invoked like the mermaid/katex partials.
- Canary test simplified to lint posture: full YAML exact-version
  assertions stay; the partial-side checks drop the anti-evasion
  machinery (comment stripping, both-ends anchoring, assignment
  counting), whose threat code review owns. The markmap line-scoping
  carve-out disappears with the factoring.
- Maintainer notes: katex bumps check the KaTeX version Hugo's
  transform.ToMath docs pair with (embedded engine renders the markup
  the pinned assets style).
@chalin
chalin marked this pull request as ready for review August 24, 2026 23:08
@chalin
chalin merged commit 5370119 into google:main Aug 24, 2026
18 checks passed
@chalin
chalin deleted the chalin-m24-katex-markmap-pins-2026-0824 branch August 24, 2026 23:09
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.

Pin the markmap-autoloader version instead of loading it unversioned Pin the default KaTeX version instead of latest

1 participant