Repository navigation
Allow CommonMark local parts in email autolinks - #234
Open
shardulsdk-mpiric wants to merge 1 commit into
Open
shardulsdk-mpiric wants to merge 1 commit into
shardulsdk-mpiric wants to merge 1 commit into
Conversation
The local part of an email autolink only accepted alphanumerics, '_', '+' and '-', so an address like <first.last@example.com> fell through to the HTML tag rule and was highlighted as a tag named "first". Use the local-part character set from the CommonMark spec instead. Reference: https://spec.commonmark.org/0.31.2/#email-autolink
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.
Email autolinks only accept
[[:alnum:]_+-]before the@, so a commonaddress like
<first.last@example.com>missesmarkdownAutomaticLinkandfalls through to the HTML tag rule:
firstis highlighted as a tag name andthe rest as tag body.
A
'in the local part (allowed by the spec) is worse: it opens anhtmlStringinside the bogus tag that runs into the following lines.This uses the local-part character set from the CommonMark spec:
https://spec.commonmark.org/0.31.2/#email-autolink
Checked that
<foo+bar@example.com>,<https://example.org>,<b>bold</b>and
<a href="mailto:x@y.z">highlight the same as before.Related, not in this PR:
<file.cfg>is also highlighted as an HTML tag,though CommonMark does not treat it as one. Happy to look at that separately
if you think it is worth fixing.