-
Notifications
You must be signed in to change notification settings - Fork 167
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 links containing [ and ] are broken #112
Comments
@RagnarGrootKoerkamp - Did you come up with a solution for this. I am also having this issue at the moment. |
https://gitlab.com/gitlab-org/gitlab/-/issues/31263#note_215961096 Not sure if it still works though; I lost those local changes after updating and didn't bother to make them again. |
Here's a page explaining a general regex for matching links in markdown: https://medium.com/@michael_perrin/match-markdown-links-with-advanced-regex-features-fc5f9f4122bc It uses the following for matching the
I'd hope that putting that bit of code here should do the trick. I'd do it myself but don't have any Ruby experience. Maybe you can test it and create a PR @stevebissett |
Thanks @RagnarGrootKoerkamp - I landed up working around this by going the conversion before using the Slack formatter, because it was easy to do so in my use case. I did have a go at trying to adjust the regex's and markdown handling to support this but I haven't managed to find working code that makes the spec pass. I am not all that familiar with Regex's at this complexity. I have pushed up a spec for it here: I did have a look at some other Ruby markdown converters like redcarpet and the RDoc markdown to try and get a better idea of some alternative approaches but didn't come right. |
The library doesn't allow
[
and]
inside a markdown link text to occur, while the spec allows:[
and]
\[
and\]
.(I came here via https://gitlab.com/gitlab-org/gitlab-ce/issues/66601, where the formatting of commit messages is broken when the message includes
[
and]
. I'd try to solve it on the gitlab side, but that's only possible when escaped brackets are picked up correctly.)The text was updated successfully, but these errors were encountered: