Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix section links on right navigation bar, which don't work when punctuated #445

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zakpatterson
Copy link

Ids are rendered differently when parsed from markdown and rendered, from when they are inserted into the vector that populates the right navigation bar. As a result, links on the right navigation bar do not work if they contain punctuation, or any characters besides [0-9a-zA-Z\-].

For example. on the page https://dioxuslabs.com/learn/0.6/, clicking the link Who's funding dioxus? appends #who's-funding-dioxus? to the url, but that anchor is rendered with the id="whos-funding-dioxus".

So I just took the code that renders id for the section based on the title, and replicated it for the code that inserts the sections into the vector that populates the menu. Unfortunately these two Section structs are different, and the one that is used in rendering the page is private.

@zakpatterson zakpatterson force-pushed the fix-right-nav-section-links-broken-if-punctuation branch from d45f492 to e6f1103 Compare February 15, 2025 18:17
@zakpatterson
Copy link
Author

zakpatterson commented Feb 19, 2025

There is a separate issue when there are ! and () inside an article title markdown, as in this page, and the "Stabilizing Manganis" title. The whole title text is not parsed and available in the text variable at this point.

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