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 aren't auto-generated for headers like in GitHub #157

Open
engineersamuel opened this issue Jan 15, 2020 · 5 comments
Open

Anchors aren't auto-generated for headers like in GitHub #157

engineersamuel opened this issue Jan 15, 2020 · 5 comments

Comments

@engineersamuel
Copy link

It seems that anchors don't work once the md is viewed in gistlog. For example I just made my first blog post: https://gistlog.co/engineersamuel/858571689dc9af802a26b63b1e8a1b56 . The TLDR What worked anchor doesn't work. However if you open the gist @ https://gist.github.com/engineersamuel/858571689dc9af802a26b63b1e8a1b56 and click the What worked then the anchor works fine.

@engineersamuel
Copy link
Author

Side note, I made this blog from GistPad in VSCode and it worked amazingly, gistlog is simple but fantastic, great work authors!

@mattstauffer
Copy link
Member

@engineersamuel Thanks for catching this! I'll look into it right now!

So glad you're enjoying Gistlog and we're so glad it's such a good match with the great work put into GistPad!

@mattstauffer
Copy link
Member

OK, so in order to do this, we'll have to build our own parser that auto-adds those IDs to the headers, like GitHub does.

That's gonna take time, if we choose to do it. In the interim, could you just add some HTML right below that header?
<a id="what-worked">

I'll try to test it myself a bit later, but that's one possible option.

@mattstauffer mattstauffer changed the title Anchors don't work Anchors aren't auto-generated for headers like in GitHub Jan 16, 2020
@engineersamuel
Copy link
Author

Ok now this is interesting. I added that <a id="what-worked"></a> but either github or gistlog modified the actual link once rendered, inspecting in dev tools shows it, in the dom, as <a id="user-content-what-worked"></a> . Hence what I'm doing now is [What worked](#user-content-what-worked) and it works!

@mattstauffer
Copy link
Member

@engineersamuel Yah, GitHub does that. I'm glad you were able to get a temporary fix! I'd still love to see if we can make this happen on our own, so I'll keep the issue open for now.

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