I am using Firefox 119.0 (64-bit) on Fedora 38. I would like to be able to copy a links that contain parenthesis to clipboard from the address bar with them as encoded. For example, when copying the URL:
https://en.wikipedia.org/wiki/The_Martian_(film)
I would like it to be copied to the clipboard as:
https://en.wikipedia.org/wiki/The_Martian_%28film%29
Mostly, I would like this capability because reddit's markdown processor is too freaking stupid to correctly process the markdown of something like [The Martian](https://en.wikipedia.org/wiki/The_Martian_(film))
and will instead link to https://en.wikipedia.org/wiki/The_Martian_(film
(missing closing paren) and display an extra closing parenthesis as text... despite the fact that superuser/stackexchange, lemmy, and github all manage to handle this scenario correctly without this issue.
At first, I thought maybe I could use browser.urlbar.decodeURLsOnCopy=false
to accomplish this. But then I saw this value is already false by default (at least on Fedora). After looking into this issue somewhat more, I believe the reason it does not behave the way I would like it to is that parenthesis are not considered as something that need to ever be escaped - I suspect per some W3C spec as encodeURIComponent
completely ignores this character.
Leaving aside the wisdom of continuing to even bother with reddit... My question is: is there some other way to achieve this goal of copying encoded parenthesis to clipboard, e.g. via some other about:config
property or via some existing addon? Or is this a lost cause and my time would be better spent writing a userscript to fix this behavior on the reddit side before posting?