You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scheme names consist of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus ("+"), period ("."), or hyphen ("-").
It cannot start with a period, which means post .https://nostr.build/i/1105.png results in the "expected" output but post.https://nostr.build/i/1105.png does not since post.https is a valid scheme name.
I think a worthwhile feature for this library is to allow restricting schemes, since I would prefer matching https://nostr.build/i/1105.png in this case as well.
Yeah. I think having an option to provide an allow-list of schemes to recognize would be nice (added a "help wanted" label). You could pass in https, http and it would only return URLs with that (and stop at characters like . or +). It's a bit trickier than that because you could also provide post.https and https and in that case it should probably use the longer match.
Activity
kosayoda commentedon Jan 1, 2023
It can, according to 3.1. Scheme:
It cannot start with a period, which means
post .https://nostr.build/i/1105.pngresults in the "expected" output butpost.https://nostr.build/i/1105.pngdoes not sincepost.httpsis a valid scheme name.I think a worthwhile feature for this library is to allow restricting schemes, since I would prefer matching
https://nostr.build/i/1105.pngin this case as well.mikedilger commentedon Jan 1, 2023
I stand corrected.
robinst commentedon Jan 5, 2023
Yeah. I think having an option to provide an allow-list of schemes to recognize would be nice (added a "help wanted" label). You could pass in
https,httpand it would only return URLs with that (and stop at characters like.or+). It's a bit trickier than that because you could also providepost.httpsandhttpsand in that case it should probably use the longer match.