SaitoTech / saito-lite-rust

a version of the Saito-Lite client written for compatibility with the Saito Rust client and binary data format
23 stars 25 forks source link

URL Identifier Fixes #2477

Open umairkhannn opened 2 months ago

umairkhannn commented 2 months ago

There are several places where URL identification and treatment are failing.

We should move away from the single regex for identification, and look to some pre-handlers that are more readable too, as the regex is a magical black box that is impossible to quickly understand and extend.

So:

Add handling first - to drop out of the function if there is an @ in the URL - this is likely an email address and can be left alone.

Split the string on # and ? and store those, adding them on to the pattern at the end so that we preserve and include the hash and the query string.

Update the regex itself to recognize one letter domains like x.com.

Image

f8daniel commented 2 weeks ago

boo

Image