-
Notifications
You must be signed in to change notification settings - Fork 91
fix: correct www autofix in no-bare-urls
#720
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
base: main
Are you sure you want to change the base?
Changes from all commits
02691dd
a874ed8
01f6976
548fe33
ef0c2f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another incorrect autofix behavior occurs when autofixing the following valid GFM input: www.example.com/a]bproduces invalid link text: [www.example.com/a]b](http://www.example.com/a]b)I reproduced an issue where Additionally, after autofixing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GFM allows any character other than whitespace and
<after the domain, and Example 626 treats the following entire URL as a valid autolink:Playground
www.google.com/search?q=(business))+okThe current autofix produces:
When parsed again, the actual link destination is truncated to:
This happens because CommonMark requires parentheses in a link destination without angle brackets to be escaped or balanced. Similarly, after autofixing
www.example.com/a\*b, the backslash is interpreted as a backslash escape, changing the URL to/a*b. In other words, the autofix silently changes valid URLs to different destinations.