Ran across this broken link here. Summit shows links differently to the webui, and probably also other apps. I think matching webui behavior is best here.

There seems to be more complex regex at play, including checking for matching brackets etc… Probably best to dig that out of the sourcecode.
Examples:
Summit: https://en.m.wikipedia.org/wiki/Orion_(spacecraft)
Raw: https://en.m.wikipedia.org/wiki/Orion_(spacecraft)
Webui: https://en.m.wikipedia.org/wiki/Orion_(spacecraft)
Summit: https://example.org/aa(aa
Raw: https://example.org/aa(aa
Webui: https://example.org/aa(aa
Summit: https://example.org/aa(aa)
Raw: https://example.org/aa(aa)
Webui: https://example.org/aa(aa)
Interestingly while writing this, I noticed the rules for android long press text select also match webui behavior.



Interesting, there is some backend logic that prevents links within paren from ending in an alpha numeric character. For instance if I send the comment
(https://google.com/), Lemmy auto changes it to(https://google.com/). I wonder if this is done to make it easier to parse links.test: (https://google.com/)