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

Markdown anchor links don't work properly #16

Open
cvax opened this issue Jan 12, 2017 · 7 comments
Open

Markdown anchor links don't work properly #16

cvax opened this issue Jan 12, 2017 · 7 comments
Labels

Comments

@cvax
Copy link

cvax commented Jan 12, 2017

Anchor links shouldn't open in a new tab.
Should be able to press browser back/forward to navigate around previously clicked anchor links.

[Test](#sometest)
# sometest
@cvax
Copy link
Author

cvax commented Jan 12, 2017

Seems to be some conflict related to the css. If you take the body's height: 100% out, it can navigate back and forth off anchor links. Unfortunately doing so breaks the theme completely so there is something else conflicting somewhere.

@alexurquhart
Copy link
Owner

Thanks for bringing that up. It's due a small jquery snippet that was supposed to add target="new" attributes to any link that goes outside of your website. It also added it to all relative links as well. I've tested it out and I think I've fixed it now in d54e167

@cvax
Copy link
Author

cvax commented Jan 13, 2017

@alexurquhart Thanks for the quick investigation. However, I am still experiencing issues. d54e167 looks to only be addressing scenario where the relative links start with / or .. For my anchor links, they all start with #.

As an example

# Blah blah

Here is some text

[Quick Start](#quick-start)

Blah blah blah

Blah blah blah

Blah blah blah

Blah blah blah

# Quick Start

hi hi hi

Edit: Ya, on my end, I added an additional href[0] !== "#" to your fix, but the issue I mentioned still persists. I can get linked to the anchor link, but I can't click back to bring me back. Stripping the css restores functionality though so I still suspect it's something in there.

@alexurquhart
Copy link
Owner

Thanks for the clarification, I updated it again and tested it with links that start with #. a4c53c1

@cvax
Copy link
Author

cvax commented Jan 13, 2017

They navigate to the anchors within the same page correctly going forward, but somehow browser back still can't bring them back to before anchor navigation.

@alexurquhart
Copy link
Owner

Looking into it further it's the .container-fluid div that acts as a wrapper for the entire layout, so the body element isn't the one that scrolls, it's the .content div. This is also leading to minor issues with the mobile navigation as well.

To fix this the CSS and markup would need to be refactored a bit. I am working on the next iteration of the theme (on the v2 branch) that doesn't have this problem, but I'd still like to fix this at some point as well.

@cvax
Copy link
Author

cvax commented Jan 13, 2017

Thanks for all the hard work. I rather like your fantastic v1 theme so hope you'll find some time to fix this issue. It makes it a bit difficult for long tutorials without being able to anchor link chapters correctly. If there is anything you'd like help on feel free to let me know. 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