Skip to content

This one doesn't parse out the link right #54

Open

Description

@mikedilger

An example that isn't parsing out right. Scheme can't have a '.' in it, right?

Just to show.. this is the list of relays that have seen this post.https://nostr.build/i/1105.png

Activity

  1. kosayoda commented on Jan 1, 2023

    @kosayoda

    It can, according to 3.1. Scheme:

    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.

  2. mikedilger commented on Jan 1, 2023

    @mikedilger
    Author

    I stand corrected.

  3. robinst commented on Jan 5, 2023

    @robinst
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions