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] Reference-style links not working in posts #21

Closed
fuzzmz opened this issue Nov 10, 2015 · 4 comments
Closed

[Markdown] Reference-style links not working in posts #21

fuzzmz opened this issue Nov 10, 2015 · 4 comments

Comments

@fuzzmz
Copy link

fuzzmz commented Nov 10, 2015

Reference-style Markdown links aren't working.

In the following example the first markdown link (Google) doesn't get turned into a hyperlink once the post is made, while the second one (this one) works as expected:

This [Google][1] link doesn't work while [this one](https://google.com "Google") does.
    [1]: https://google.com "Google"

Ties to flarum/framework/issues/630

@JoshyPHP
Copy link
Member

I replied on the other page but I'll leave a comment here as well. I think that the syntax for reference links is cruft and implementing it would make the library worse. I don't think there's a use case for it in modern applications.

@fuzzmz
Copy link
Author

fuzzmz commented Nov 11, 2015

I have nothing against not having this feature. I only came across it as I've been toying with integrating @flarum as a commenting system for a @pelican powered blog, and was using the article summary as forum post contents, which in my case happened to use reference-style links.

@JoshyPHP
Copy link
Member

I've thought about it and decided to implement reference links and images. I don't think anyone will really use it but I was able to implement it without adding too much code and without any impact on the runtime performance. The syntax is consistent with the original Markdown, if a little bit more flexible.

For reference, this is the new supported markup: (compare it on Babelmark 2)

* [label]
* [text][label]
* ![label]
* ![text][label]
* [![label]][label]

[label]: http://example.org/img.png "Title"

@fuzzmz
Copy link
Author

fuzzmz commented Nov 15, 2015

Thanks @JoshyPHP! 👍

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