Patreon Logo Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal Logo PayPal. You can also buy games using our partner links for GOG and Humble Store.
Title: Markdown URLs consume all close parentheses [FIXED]
WorMzy 16 Apr 2021
[This url markdown has four close parentheses after it](https://gamingonlinux.com)))))

[This url markdown does not](https://gamingonlinux.com)

It seems these trailing parentheses also break the hyperlink (both the above should direct to the Gaming on Linux homepage). Quoting this post may explain things better, otherwise this image captures what I mean: https://imgur.com/a/hlsLVez

This behaviour can be worked around by inserting a space between the close parentheses and those trailing, but it seems the regex involved with URL parsing is too greedy (assuming regex is involved)

Last edited by GamingOnLinux Bot on 17 Apr 2021 at 10:46 am UTC
This topic has an answer marked - jump to answer.
Liam Dawe 17 Apr 2021
Hi, thanks for the report, looks like I managed to solve it.
WorMzy 20 Apr 2021
It seems this change breaks URLs that legitimately have close parentheses in them. i.e.
[Wikipaedia - Conda (package manager)](https://en.wikipedia.org/wiki/Conda_(package_manager))

Looks like some other markdown-capable sites have wrestled with this, and some have implemented fancy regex to ignore matched parentheses and others have settled for users escaping close parentheses or percent-encoding the parentheses (the former is not currently supported here).

My suggestion would be to support optional URL quoting, i.e.
 
[Wikipaedia - Conda (package manager)]("https://en.wikipedia.org/wiki/Conda_(package_manager)")

So everything between (" and ") is used as-is, parentheses and all. Not sure how easy that would be to implement though.
Liam Dawe 20 Apr 2021
The REGEX has been upgraded once again, this time to allow quotes within the brackets to allow matching as suggested. FYI though, percent-encoding the parentheses did work before:

 
 [Wikipaedia - Conda (package manager)]("https://en.wikipedia.org/wiki/Conda_(package_manager)")

[Wikipaedia - Conda (package manager)]("https://en.wikipedia.org/wiki/Conda_(package_manager)")

 [Wikipaedia - Conda (package manager)](https://en.wikipedia.org/wiki/Conda_(package_manager%29)
[Wikipaedia - Conda (package manager)](https://en.wikipedia.org/wiki/Conda_(package_manager%29)
WorMzy 20 Apr 2021
Great work! :D

I meant the escaping doesn't work, i.e.
[Wikipaedia - Conda (package manager)](https://en.wikipedia.org/wiki/Conda_(package_manager\))

[Wikipaedia - Conda (package manager)](https://en.wikipedia.org/wiki/Conda_(package_manager\))

Not an issue now, of course. :)
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon Logo Patreon. Plain Donations: PayPal Logo PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
Login / Register