Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing for URLs with parenthesis in them #35

Open
alexaandru opened this issue Mar 2, 2024 · 2 comments
Open

Incorrect parsing for URLs with parenthesis in them #35

alexaandru opened this issue Mar 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@alexaandru
Copy link

Given a file that includes:

// https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters

I would expect https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters to be parsed as URL. However, when I inspect the parse tree, I see that it says:

(comment ; [28, 0] - [28, 91]
  (source ; [28, 0] - [28, 91]
    (uri))) ; [28, 3] - [28, 79]

it considers it as URL up to, but not including, the closing parenthesis: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition.

@stsewd
Copy link
Owner

stsewd commented Mar 7, 2024

Hi, this is mostly because ) is considered a stop words like (URL)wods.. or (URL). words... But I'll see if the rules can be relaxed.

@stsewd stsewd added the bug Something isn't working label Mar 7, 2024
@alexaandru
Copy link
Author

As per the URL RFC spec:

Thus, only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.

that URL is perfectly legal. Thank you for looking into this :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants