CouscousPHP / Couscous

Couscous is good.
https://couscous.io
Other
840 stars 104 forks source link

Reference-style links to .md files aren't resolved to the generated url #155

Open Firehed opened 8 years ago

Firehed commented 8 years ago

Using a reference-style link fails to automatically convert a markdown file url to its html counterpart, which is inconsistent with the documentation indicating that links should work between pages.

That is to say:

Using [a link](foo.md) to [a page][bar] or [baz][]

[bar]: bar.md
[baz]: baz.md

renders

Using <a href="foo.html">a link</a> to
<a href="bar.md">a page</a> or <a
href="baz.md">baz</a>

instead of

Using <a href="foo.html">a link</a> to
<a href="bar.html">a page</a> or <a
href="baz.html">baz</a>

In practice it's not really a huge issue, but it's not quite what you would expect to happen.

mnapoli commented 8 years ago

Right, I'm guessing that this class only rewrites classic links and not reference-style links. I'm guessing #134 (i.e. replace Parsedown with CommonMark) would help since we could get rid of the regex and directly edit the AST that was generated from the markdown source. But for that we need to have a CommonMark extension for Markdown Extra, because currently that's a feature offered by Couscous.

mnapoli commented 8 years ago

On the "CommonkMark" topic I've opened #156.