saito-lite-rust icon indicating copy to clipboard operation
saito-lite-rust copied to clipboard

URL Identifier Fixes

Open umairkhannn opened this issue 10 months ago • 1 comments

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

umairkhannn avatar Apr 22 '24 04:04 umairkhannn

boo

Image

f8daniel avatar Jun 19 '24 06:06 f8daniel