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

Server islands-rendered footnote links generated by remark-rehype do not link to the current page #2794

Closed
JakeIsMeh opened this issue Sep 23, 2024 · 3 comments

Comments

@JakeIsMeh
Copy link

Environment

  • Operating System: Windows_NT
  • Node Version: v22.8.0
  • Nuxt Version: 3.13.2
  • CLI Version: 3.13.2
  • Nitro Version: -
  • Package Manager: [email protected]
  • Builder: -
  • User Config: compatibilityDate, devtools, future, experimental, modules
  • Runtime Modules: @nuxt/[email protected]
  • Build Modules: -

Reproduction

https://github.com/JakeIsMeh/content_islands_footnotes_repro

Describe the bug

When using server islands to render markdown, footnotes generated by remark-rehype link to the root (/) rather than the current page. The links work when using client-side rendering.

Additional context

This setup is adapted from https://roe.dev/blog/nuxt-server-components

Having attempted to debug this myself, I noticed that $nuxt.route was undefined during server rendering, however I'm not sure how else to proceed.

Logs

No response

@JakeIsMeh
Copy link
Author

See nuxt/nuxt#27949.

@JakeIsMeh
Copy link
Author

JakeIsMeh commented Oct 4, 2024

Actually, this can be fixed without access to the current route. Since these footnote references are simply anchors, the href simply needs to be the dom id of the anchor.

@JakeIsMeh
Copy link
Author

Sorry to ping @farnabaz, would you mind re-opening this issue?

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

No branches or pull requests

1 participant