Skip to content

Loading…

URL References dont work across sections #100

Closed
phenomnomnominal opened this Issue · 3 comments

3 participants

@phenomnomnominal

It would seem that URL references e.g.

[Google][1], [1]: http://www.google.com
[GitHub][], [github]: http://www.github.com

only work within the single block-comment in which they are declared?

For example:

# Look at this link to [Google][]! 
#
# [google]: http://www.google.com

would work, but

# Look at this link to [Google][]!

# [google]: http://www.google.com

wouldn't.

Unless I'm doing something heaps wrong (and please tell me if I am), this means that one of the main possible benefits of using them - being able to refer to them multiple times in a document - doesn't work.

Would there be a way to gather all the URL references and use them throughout the documentation?

@keithamus
Collaborator

This is due to the way that Docco parses comments, taking each line at a time and pushing that through a Markdown translator (showdown). Your second example is actually two separate markdown documents (according to the current implementation of Docco).

Referring to them multiple times in a document will currently not work because of this. This would be a worthy enhancement, but a very big one. It might help to switch from the Showdown markdown parser to https://github.com/chjj/marked markdown parser. I'll leave that for others to hash out though.

@phenomnomnominal

Thanks for the reply, that's pretty much what I suspected.

@justindujardin justindujardin added a commit that referenced this issue
@justindujardin justindujardin Fix for issue #100: Batch process markdown docs in the same way that …
…code highlighting is handled.

Add test to verify that url references work properly.
54d58e1
@justindujardin
Collaborator

@keithamus Pull request #112 fixed this, so it can probably be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.