Conversation
With extension.autolink enabled, three cases diverged from cmark-gfm (kivikakk#832). url_match now calls check_domain with allow_short = 1, as cmark-gfm does, so a dot-less host such as http://localhost/x autolinks again (as it did up to 0.43.0; changed in kivikakk#618). As in sd_autolink_issafe, the first character after the scheme must be a valid host character, so a bare http:// still does not autolink. http://user:pass@host/ is now matched as a whole instead of falling through to the email matcher. The scheme is compared case-insensitively, as in sd_autolink_issafe, so HTTP://www.example.com/ autolinks; www. matching stays case-sensitive. The autolink matchers consult the bracket stack rather than a flag cleared by any ], matching cmark_inline_parser_in_bracket: an autolink is refused anywhere inside an open bracket, so an inner ] no longer lets an autolink run through an enclosing link, producing a link inside a link.
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

With
extension.autolinkenabled, comrak diverged from cmark-gfm in three cases (#832).url_matchnow callscheck_domainwithallow_short = 1as cmark-gfm does, so dot-less hosts such ashttp://localhost/xautolink again (they did through 0.43.0; the requirement of a dot dates to #618), while a new check mirroring the host-character test insd_autolink_issafekeeps barehttp://from linking;http://user:pass@host/is likewise matched whole instead of falling through to the email matcher.The scheme is now compared case-insensitively, matching
sd_autolink_issafe, soHTTP://www.example.com/autolinks whilewww.matching stays case-sensitive.Finally, the autolink matchers consult the bracket stack rather than a flag cleared by any
], mirroringcmark_inline_parser_in_bracket, so an inner]no longer lets an autolink run through an enclosing link or produce an<a>nested inside an<a>. Fixture tests are added for each case.