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

Anchors in Markdown #4

Closed
alexroseb opened this issue May 16, 2018 · 3 comments
Closed

Anchors in Markdown #4

alexroseb opened this issue May 16, 2018 · 3 comments

Comments

@alexroseb
Copy link

Anchor links aren't working. I see in the code that headers have id's properly (without needing to manually implement them, nice!) but when I put anchors up in a table of contents the links don't do anything. I even tried adding manual anchors using HTML in my md but it still didn't do anything.

@zerodevx
Copy link
Owner

Good issue - thanks for raising this!

I guess in a sense, this is expected behaviour (as the adage goes, it's a feature, not a bug) - because the generated HTML is stamped into its own shadow DOM and hence "protected" from the outside... Anchor links work by pointing to an element's id, of which the document is unable to find because it's encapsulated.

But you raised a very good point. I'll do a PR to add this feature.

In the meantime, as a workaround, try setting the no-shadow attribute and see if it works.

For example,

<zero-md src="..." no-shadow></zero-md>

@zerodevx
Copy link
Owner

And... done.

v1.1.0 should support anchor links now.

@alexroseb
Copy link
Author

Nice turnaround time! Works great now. Thank you!

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

2 participants