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

Angle bracket enclosed URL in reference link fails. #33

Open
cirosantilli opened this issue May 12, 2014 · 4 comments
Open

Angle bracket enclosed URL in reference link fails. #33

cirosantilli opened this issue May 12, 2014 · 4 comments

Comments

@cirosantilli
Copy link

Input:

[a][b]

[b]: <http://a.com>

The output href contains <>, but the original docs http://daringfireball.net/projects/markdown/syntax#link say it should work:

The link URL may, optionally, be surrounded by angle brackets

and it works on every major implementation except multi markdown.

If I could turn back time, I would not allow angle brackets like your implementation: it is better to have a single way of doing things.

But what is done is done, so until we have a markdown specification, it is better to be compatible IMHO.

Discovered with the Markdown Test Suite at karlcow/markdown-testsuite#50 . Congrats: this is the only failing test!

@cirosantilli cirosantilli changed the title Angle bracket enclosed URL in ID reference link fails. Angle bracket enclosed URL in reference link fails. May 12, 2014
@jgm
Copy link
Owner

jgm commented May 12, 2014

I agree, that's a bug. (Note: multimarkdown uses peg-markdown
code for its core markdown parsing, so no surprise that it fails too.)

There are other implementations that fail also:
http://johnmacfarlane.net/babelmark2/?normalize=1&text=%5Ba%5D%5Bb%5D%0A%0A%5Bb%5D%3A+%3Chttp%3A%2F%2Furl.com%3E%0A

I'm not actively maintaining peg-markdown any more, so I may not get
around to fixing this. (I've got something better which I hope to
release before long.)

@cirosantilli
Copy link
Author

@jgm thanks for the very informative reply.

Is babelmark2 open source? In particular, I would like to see the normalization code, and how you are calling each engine to use it on the Markdown Test Suite.

I meant in no way that you should fix this yourself: just filling the database =) I recommend putting either a "deprecated in favor of" or "looking for maintainers" notice on the repo description or at the top of the README.

You got me curious now: the other thing you are working on is it closed source? Is it another markdown engine? What language will it be written on?

@jgm
Copy link
Owner

jgm commented May 12, 2014

babelmark2 isn't currently open source, but I'm using the
beautify-html javascript library to normalize.

To call the different engines, I just make HTTP requests. See the FAQ
on how to add an engine. Different people maintain the servers for
different engines, freeing me of the responsibility to keep them all
updated.

The new thing I'm working on is a complete spec and very comprehensive
test suite for markdown, with a C implementation that parses the
syntax efficiently. It will all be open source, but it's not ready
yet.

@cirosantilli
Copy link
Author

Cool. The markdown test suite also aims at making a spec: https://github.com/karlcow/markdown-testsuite/blob/master/markdown-spec.html, but is still too basic. The tests on the other hand are good I think: 103 total. Hope both projects can work together as closely as possible.

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