Skip to content

fix: pretty url toc highlighting#3028

Open
bens-schreiber wants to merge 2 commits intorust-lang:masterfrom
bens-schreiber:schreiber/fix-pretty-urls
Open

fix: pretty url toc highlighting#3028
bens-schreiber wants to merge 2 commits intorust-lang:masterfrom
bens-schreiber:schreiber/fix-pretty-urls

Conversation

@bens-schreiber
Copy link
Copy Markdown

@bens-schreiber bens-schreiber commented Feb 9, 2026

This fix compares the current page to the active page, ignoring the .html suffix.

fixes #3034

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Feb 9, 2026
@jhult
Copy link
Copy Markdown
Contributor

jhult commented Mar 8, 2026

Related PRs: #3038, #2993, #2570

@dv1x3r
Copy link
Copy Markdown

dv1x3r commented Mar 30, 2026

Thank you! As a workaround, it is also possible to apply this patch using the Makefile command:

.PHONY: docs
docs:
	mdbook build docs/
	find docs/book -name 'toc*.js' -print0 | xargs -0 sed -i 's@if (link.href === current_page@if (link.href.replace(/\.html$$/, "") === current_page.replace(/\.html$$/, "")@g'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TOC highlighting breaks on prettified URLs

4 participants