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 containing anchors #106

Open
CodaCodr opened this issue Aug 10, 2016 · 4 comments
Open

Links containing anchors #106

CodaCodr opened this issue Aug 10, 2016 · 4 comments

Comments

@CodaCodr
Copy link

I'm coming from Docco so maybe my syntax is suspect...

I want to write

See [myFunction](somefile.js.html#myfunction)

but docker is adding ".html" to the href:

See <a href="somefile.js.html#myfunction.html">myFunction</a>

Is this a bug? Is there a workaround (short of writing out the a element longhand)?

@alinex
Copy link
Contributor

alinex commented Aug 10, 2016

Looks like docker is adding .html always to the end of the link (for local links). This should be easy to fix, maybe I have a look tomorrow.

@CodaCodr
Copy link
Author

Agreed. That's exactly what it's doing. But I wouldn't call that "local". "relative", maybe? Either way, anchors should be preserved and not appended to.

@jbt
Copy link
Owner

jbt commented Aug 10, 2016

That sounds a lot like I did something stupid and forgot that anchor links were a thing. Definitely a bug, good spot!

Should be a matter of replacing the bit that adds .html onto the end with something like .replace(/(#|$)/,'.html$1') - that way you can do [](file.js) -> file.js.html or [](file.js#anchor) -> file.js.html#anchor.

@alinex
Copy link
Contributor

alinex commented Aug 11, 2016

@jbt that should work if set in that line:

tokens[idx].attrs[hrefIndex][1] += '.html';

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

3 participants