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

remark-slug doesn't take current URL into consideration #13

Closed
mcmxcdev opened this issue Aug 20, 2020 · 2 comments
Closed

remark-slug doesn't take current URL into consideration #13

mcmxcdev opened this issue Aug 20, 2020 · 2 comments
Labels
🙋 no/question This does not need any changes

Comments

@mcmxcdev
Copy link

Problem

remark-slug currently just takes the text content of the heading and slugifies it for remark-autolink-headings, I assume.

Unfortunately, I am on a nested URL like: /blog/contributing-to-open-source-projects-the-right-way and not on the root path, therefore the a link redirects me to the root page instead of staying on the current page and jumping down.

Is there any solution or config option for that?

Expected behaviour

Jump to the anchor

@mcmxcdev mcmxcdev added 🙉 open/needs-info This needs some more info 🦋 type/enhancement This is great to have labels Aug 20, 2020
@ChristianMurphy ChristianMurphy added 🙋 no/question This does not need any changes and removed 🙉 open/needs-info This needs some more info 🦋 type/enhancement This is great to have labels Aug 20, 2020
@ChristianMurphy
Copy link
Member

@mhatvan adds id attributes to elements, it doesn't change links.
You can use anchor links, which don't switch what page you are on.
https://www.rapidtables.com/web/html/link/html-anchor-link.html

@mcmxcdev
Copy link
Author

mcmxcdev commented Aug 20, 2020

Yea I am aware of that but I meant that remark-autolink-headings takes the slug provided by remark-slug.

In case you are interested: I found out that the issue that I am encountering is indeed not relevant to this library, but the framework that I am using.

https://www.ryanfiller.com/blog/things-svelte-and-sapper-cant-do-yet#sappers-router-doesnt-work-with-hash-links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes
Development

No branches or pull requests

2 participants