Skip to content

Conversation

@erikgaas
Copy link
Contributor

@erikgaas erikgaas commented Dec 12, 2025

The CommonMark link on the docs index page goes to .md instead of index.html.md, causing a 404.

The original fix script had the right logic — it uses data-original-href which Quarto preserves with the correct URL. However, it ran on DOMContentLoaded, which is before Quarto's JS mangles the href. So by the time the fix ran, the href was still correct, and then Quarto broke it afterward.

This PR adds a setTimeout so the fix runs after Quarto's JS completes.

Testing: Verified manually on the live site by running the fix logic in the browser console — confirmed the selector finds the element and the fix restores the correct href. I haven't figured out how to make local testing repro because it works fine in local Quarto builds.

Fixes #795

The previous fix looked for data-original-href which Quarto doesn't set.
New approach directly finds the broken ".md" link and fixes it to
"index.html.md".

Fixes #795
@gitnotebooks
Copy link

gitnotebooks bot commented Dec 12, 2025

Review these changes at https://app.gitnotebooks.com/AnswerDotAI/fasthtml/pull/810

@erikgaas erikgaas marked this pull request as draft December 12, 2025 19:54
The original fix logic was correct but ran too early. Quarto's JS
mangles the href *after* DOMContentLoaded, so the fix had no effect.

Added setTimeout to run the fix after Quarto's JS completes.

Fixes #795
@erikgaas erikgaas marked this pull request as ready for review December 12, 2025 20:02
@erikgaas erikgaas added the documentation Improvements or additions to documentation label Dec 12, 2025
@erikgaas erikgaas mentioned this pull request Dec 12, 2025
4 tasks
@erikgaas erikgaas requested a review from jph00 December 17, 2025 03:35
@jph00 jph00 merged commit 98f3c3c into main Dec 22, 2025
0 of 2 checks passed
@jph00 jph00 deleted the erikgaas/fix-795 branch December 22, 2025 04:41
@jph00
Copy link
Contributor

jph00 commented Dec 22, 2025

Thanks @erikgaas. FYI this is a problem in all Quarto/nbdev projects - so even better would be to fix it at the source, if possible!

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clicking CommonMark takes you to 404 url

3 participants