Change in-text link detection RegEx
On mobile and on PC there is different RegEx. Mobile version often drop last ")" symbol in links, for example a lot of links to Wikipedia pages have them.
Example of dropped ")"

My proposal - use this regex: https://regex101.com/r/dK2tAe/5
You can check the difference between this RegEx and Discord's, by just posting this list somewhere in chat and comparing.
I've constructed it, using a popular list of valid and invalid links, and it's based on simplicity, readability and small amount of symbols. There was some examples of "good" RegEx, from non-readable 37 symbols to overconstructed 979 symbols. Mine is only 36.
Well, you can use any RegExp you want, actually, but... Why PC and mobile is so different? There is a lot of false detections on mobile. Shouldn't they be same?
U moet u aanmelden om een opmerking te plaatsen.
Opmerkingen
0 opmerkingen