this post was submitted on 11 Aug 2025
14 points (100.0% liked)

Summit

1355 readers
3 users here now

Community to discuss Summit, an open-source Android app for browsing Lemmy and PieFed.

Get the app on the Play Store.

F-Droid

APK / Obtainum

Source code

Support the app

Support me on Patreon

Website: https://summit.idunnololz.com/

founded 3 years ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] Redjard@lemmy.dbzer0.com 2 points 10 months ago (1 children)

I got linkify-it to run with nodejs with some minor modifications and this is the output of console.log(re.tpl_link_fuzzy);: https://files.catbox.moe/8y1bfx.regex (tpl_link_fuzzy.regex, 18.47kiB)

Just paste 19kB of raw regex into your code, noone has ever regretted pasting 19kB of regex into their code.

[–] idunnololz@lemmy.world 1 points 10 months ago (1 children)

This doesn't convert cleanly to java/kotlin. At least one of the groups is messed up and I am not going to go through 19,000 characters to find each one. I found a library that looks promising and I'll try that instead.

[–] Redjard@lemmy.dbzer0.com 3 points 10 months ago (1 children)

Understandable. I have an even worse idea then: https://files.catbox.moe/71dzf7.base64 (tpl_link_fuzzy.regex.base64, 24.63kiB)

Take this base64, and decode it in kotlin into a string variable. And then maybe make kotlin give it to you in a form you can paste back into the code idk

[–] idunnololz@lemmy.world 2 points 10 months ago

I will consider this is all else fails but I also don't have high hopes this regex would even work.