Closed n0toose closed 3 years ago
I think this part of the code should be in a loop until a token is found or the string is exhausted: https://github.com/HaikuArchives/Vision/blob/80260e64e84e0a33d7ae0e487245a23c077767b9/src/URLCrunch.cpp#L72..L108
The current loop finds the first URL marker in the string, and #
is one of them. So when there's nothing better before, #_#haiku:matrix...
is chosen. The other part calculates the end, but also discards the found mark (and advances a position) if there's nothing suitable after the prefix. And one of the conditions there is that the first character must be a number, a letter or a slash. _
is neither, so it should advance and try again, but there's no loop and returns with an error. The caller then goes on with life as it's told there are no more URLs.
It should also currently fail for https://_what.example.com | Logs: https://oftc.irclog.whitequark.org/haiku
, I think.
We found out that any URLs past
Matrix:
would not work.Anything past Matrix does not get marked as a URL, specifically the
Logs
.Me and @humdinger joined a test channel and found out the root cause methodically, by progressively stripping the topic apart:
Removing the first
#
in#_oftc_#haiku:matrix.org
makes theLogs:
link work.