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

code in header produce invalid anchor #105

Closed
ghost opened this issue Jan 3, 2019 · 4 comments
Closed

code in header produce invalid anchor #105

ghost opened this issue Jan 3, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 3, 2019

If you use some markup like this:

`Alpha`
-------

beta

I would expect this result:

#alpha

however what is generated is:

#codealphacode
@ghost ghost changed the title code in header product invalid anchor code in header produce invalid anchor Jan 4, 2019
@bryanbraun
Copy link
Owner

@cup, thanks for checking in on this.

I'm assuming that those ` marks are producing <code> tags in the html. I tried to reproduce this situation in this Codepen (AnchorJS 4.2.0 with both Markdown and HTML) but the IDs seem fine when I hover over them.

Are you using an older version of AnchorJS? Perhaps it's only happening in a specific browser?

It would be 👌 if you could show me a example of the issue.

@ghost
Copy link
Author

ghost commented Jan 5, 2019

@bryanbraun uh yeah simple

http://svnpenn2.github.io/bravo

@bryanbraun
Copy link
Owner

Cool thanks.

It looks like AnchorJS isn't generating those IDs. If I disable Javascript in my browser and load the page it still says id="codealphacode", so they must be created by the Markdown converter.

(by default, AnchorJS only generates IDs if the element doesn't already have an ID)

I saw that you already created an issue at github/jekyll-commonmark-ghpages#10, so I'm thinking about closing this one.

For what it's worth, you may be able to tweak your markdown settings to disable ID generation, or switch to a different markdown parser to work around the issue.

@ghost
Copy link
Author

ghost commented Jan 5, 2019

@bryanbraun yes i agree with you on all fronts - it seems the issue is that
"commonmarker", and in turn "jekyll-commonmark-ghpages" dont strip formatting
from header text for automatic ID generation, and dont even have an option for
it - contrast that with KramDown which does:

https://jekyllrb.com/docs/configuration/markdown

sadly KramDown has its own problems:

jekyll/jekyll#7417

so it seems like the best option currently is to just stick with
"jekyll-commonmark-ghpages" and make sure I have nothing strange in my header
text.

jhjohn123 referenced this issue May 16, 2019
The Jasmine update caused our tests to run in random order by default,
which resulted in occasionally failing tests. By making some
adjustments to the tests, we were able to get them passing consistantly.
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