Closed jgarte closed 6 months ago
@wangp
Where could I start looking in the bower code base if I'd like to make a PR to add this?
I'm a bit lost at the moment.
Oh, maybe here?
Would I need to extend detect_url_2
?
Yes detect_url_2
should succeed if it detects a URL in String
after index BeginAt
, where Start
and End
are the start and end indexes of the URL in String
. A starting point would be to search for "gemini" with string_util.unsafe_strstr
and go from there. However, I would be unhappy with scanning each string twice.
Yes
detect_url_2
should succeed if it detects a URL inString
after indexBeginAt
, whereStart
andEnd
are the start and end indexes of the URL inString
. A starting point would be to search for "gemini" withstring_util.unsafe_strstr
and go from there. However, I would be unhappy with scanning each string twice.
Is there a way to see if it's in an array of elements? I'm not sure, and don't know mercurial. I don't think this would be a good idea as we're just hardcoding the valid schemes, whilst there's a RFC for schemes.
Wouldn't modifying the check to make it highlight any valid URI that follows the RFC 3986's Scheme be a better idea? Such that every scheme is not needed to be hardcoded.
We should use a multi-string search algorithm. It's probably easiest to use the POSIX regex functions to search for http|gemini
. I don't see any need to highlight all possible URIs; in fact I'd prefer it did not. I can't remember ever wanting to open any URI other than http(s) straight from the mail client.