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. You can also buy games using our partner links for GOG and Humble Store.
Markdown URLs consume all close parentheses [FIXED]
WorMzy Apr 16, 2021
This url markdown has four close parentheses after it)))

This url markdown does not

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 Liam Dawe on 17 April 2021 at 10:46 am UTC
This topic has an answer marked - jump to answer.
Liam Dawe Apr 17, 2021
Hi, thanks for the report, looks like I managed to solve it.
WorMzy Apr 20, 2021
It seems this change breaks URLs that legitimately have close parentheses in them. i.e.
Wikipaedia - 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 Apr 20, 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)

 [Wikipaedia - Conda (package manager)](https://en.wikipedia.org/wiki/Conda_(package_manager%29)
Wikipaedia - Conda (package manager)
WorMzy Apr 20, 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)

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

Reward Tiers: Patreon. Plain Donations: 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


Or login with...
Sign in with Steam Sign in with Google
Social logins require cookies to stay logged in.