Skip to content

Comments

Add ScrollSpy patch workflow and runtime patch#2382

Merged
chalin merged 1 commit intogoogle:mainfrom
chalin:chalin-m24-scrollspy-patch-2025-1117
Nov 18, 2025
Merged

Add ScrollSpy patch workflow and runtime patch#2382
chalin merged 1 commit intogoogle:mainfrom
chalin:chalin-m24-scrollspy-patch-2025-1117

Conversation

@chalin
Copy link
Collaborator

@chalin chalin commented Nov 18, 2025

  • Contributes to TOC scrolling results in runtime error when heading ID starts with a digit #2329
  • Introduces a workflow for patching Bootstrap's ScrollSpy to handle special heading IDs, including scripts for extracting, patching, and updating the patched method. Adds the runtime patch (assets/js/scrollspy-patch.js), supporting cache and patch files, and updates build scripts and Hugo integration to apply the patch automatically.
  • Also improves formatting and script organization in package.json and related scripts.
  • I'll revert the previous (partial) workaround in a followup PR
  • I've tested this patch method with heading IDs that start with numbers, and containing invalid CSS-selector-name chars like ., and ScrollSpy handles them correctly without crashing.

Introduces a workflow for patching Bootstrap's ScrollSpy to handle special heading IDs, including scripts for extracting, patching, and updating the patched method. Adds the runtime patch (assets/js/scrollspy-patch.js), supporting cache and patch files, and updates build scripts and Hugo integration to apply the patch automatically. Also improves formatting and script organization in package.json and related scripts.
@chalin chalin force-pushed the chalin-m24-scrollspy-patch-2025-1117 branch from 3b32183 to 9cae3e9 Compare November 18, 2025 13:03
@chalin chalin merged commit 2570ad5 into google:main Nov 18, 2025
6 of 11 checks passed
@chalin chalin deleted the chalin-m24-scrollspy-patch-2025-1117 branch November 18, 2025 13:03
@chalin chalin added this to the 25Q4 milestone Nov 22, 2025
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.

1 participant