Add a bit more URL recognition intelligence
If you have code with a URL contained in single quotes, Notepad3 includes the final single quote in the URL. What happens with a CTRL-click on the URL is (usually) a 404 since the url doesn't actually end in '.
Because ' is a legal URL character, I understand why it is doing that, but could some logic be added to be a bit smarter about it? At a minimum, don't include a ' at the end of the url if the URL is immediately preceded by a '.
Basically, it should be easy to identify an invalid ' in a line like (This is what I encounter a lot.):
$URL = 'https://example.com'
It gets harder in a line like (totally made up code because I am not aware of a real example):
<definition:'url=https://example.com'>
Although, there simply cannot be all that many actual pages with URLs that end in ', so simply ignoring it at the end of any URL string would probably be correct 99.999% of the time.
Thanks!
FYI this was brought up in the past, and some reasoning given
https://github.com/rizonesoft/Notepad3/issues/3875#issuecomment-1004195819
Hello @teknowledgist , @jupester,
Indeed the case with a ' at the end of an URL is not correctly handled.
I hoop @RaiKoHoff finds some time to fix it? 😢
Hrmmm... I see there are definitely complications beyond what I was considering. Paraphrasing some of @RaiKoHoff 's example:
https://example.com/HomerSimpson's life/work is a valid URI, but checking for a space after the ' isn't enough.
https://example.com/MontgomeryBurns' life/work is also valid. Counting ' won't work either.
https://example.com/NedFlanders' 'life'/'work' is also valid.
(Why anyone would be stupid enough to include multiple spaces or apostrophes in a URI is different question!)
Why anyone would be stupid enough to include multiple spaces or apostrophes in a URI is different question!
Notepad3 already supports "apostrophes" in URLs. However, "one or more spaces" in a URL are hypothetical cases where I don't recommend Notepad3 support.