Improve link regex to fix handling paranthesis and question marks
I was super frustrated with links in NeoChat, stuff like the new Plasma bot to show VHI/RHI bugs would get absolutely decimated. Yes, the irony of not being able to check on bugs, because of a KDE matrix client bug isn't lost on me :-p
This patch fixes two key issues:
-
?
is considered part of the URL, even if there might not be anything past it. I've seen people now putting spaces after URLs to get around this issue. -
)
is also part of the URL, as well as:
despite those not being valid characters at the end of URLs.
I barely understood Regex before this, but was able to piece together something using conditional look-aheads.
Before
After
Edited by Joshua Goins