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

Issue when converting links that contain parenthesis #8

Open
joesfer opened this issue Jan 1, 2022 · 0 comments
Open

Issue when converting links that contain parenthesis #8

joesfer opened this issue Jan 1, 2022 · 0 comments

Comments

@joesfer
Copy link

joesfer commented Jan 1, 2022

Hi,

I found your plugin really useful -- thank you for sharing.

I would like to let you know about an issue I found when converting markdown to wiki links if these contain parenthesis. The regular expression will incorrectly terminate on the first parenthesis found, thus chopping the link.

This is an example of the link format that will be handled incorrectly:

[some link title](../path/Smith, John (2001). Title Of Book.md)

With some quick testing, a greedy match between the parenthesis seems to match the entire contents correctly:

\[([^\]]*)\]\((.+)\)

Here's my test https://regexr.com/6ci5n

The greedy match might however fail with multiple links in the same line. Hopefully, though, it will serve to illustrate the problem.

Thanks again for your work,
Jose

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

1 participant