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

Links to header anchor does not work #94

Closed
veelenga opened this issue Jan 13, 2015 · 4 comments
Closed

Links to header anchor does not work #94

veelenga opened this issue Jan 13, 2015 · 4 comments
Labels
Milestone

Comments

@veelenga
Copy link

Default markdown syntax not working with grip:

[LinkName](#Header1)
...

## Header1

Real example you can find in prelude repo (table of contents section).

@joeyespo joeyespo added the bug label Jan 13, 2015
@joeyespo
Copy link
Owner

You're right! There's code that specifically handles this case. Looks like GitHub now uses HTML id instead of name to mark their README anchors.

Should be an easy fix in /grip/templates/index.html

function scrollToHash() {
  if (location.hash && !document.querySelector(":target")) {
    var element = document.getElementById('user-content-' + location.hash.slice(1));
    if (element) {
       element.scrollIntoView();
    }
  }
}

If you need this immediately, feel free to patch your local install. I'll deploy a new version with this fix as soon as I have some time.

Thanks for opening the issue!

@veelenga
Copy link
Author

Thanks for quick response. Sure, i can use patch locally and wait fix.

@joeyespo joeyespo added this to the 3.1 milestone Feb 7, 2015
@joeyespo
Copy link
Owner

joeyespo commented Feb 9, 2015

Just released a new version with a fix to this. Be sure to pip install --upgrade grip.

@veelenga
Copy link
Author

veelenga commented Feb 9, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants