@@ -2654,25 +2654,44 @@ contexts:
26542654 3 : punctuation.definition.reference.end.markdown
26552655 4 : punctuation.separator.key-value.markdown
26562656 push :
2657- - link-def-end
2657+ - link-def-meta
2658+ - link-def-attr
26582659 - link-def-title
26592660 - link-def-url
26602661
2661- link-def-end :
2662+ link-def-meta :
26622663 - meta_include_prototype : false
26632664 - meta_scope : meta.link.reference.def.markdown
26642665 - include : immediately-pop
26652666
2667+ link-def-attr :
2668+ - match : \{
2669+ scope : punctuation.definition.attributes.begin.markdown
2670+ set : link-def-attr-body
2671+ - match : ^(?!\s*{)|(?=\S)
2672+ pop : true
2673+
2674+ link-def-attr-body :
2675+ - meta_scope : meta.attributes.markdown
2676+ - include : tag-attributes
2677+
26662678 link-def-title :
26672679 - match : ^(?!\s*["'(])
26682680 pop : 1
26692681 - match : (?=["'(])
26702682 set :
2671- - expect-eol
2683+ - expect-attr-or- eol
26722684 - link-title
2685+ - match : (?=\{)
2686+ pop : true
26732687 - match : \S.+
26742688 scope : invalid.illegal.expected-eol.markdown
26752689
2690+ expect-attr-or-eol :
2691+ - match : (?=\{)
2692+ pop : true
2693+ - include : expect-eol
2694+
26762695 link-def-url :
26772696 - match : <
26782697 scope : punctuation.definition.link.begin.markdown
@@ -2821,20 +2840,29 @@ contexts:
28212840
28222841 code-spans :
28232842 # https://spec.commonmark.org/0.30/#code-spans
2824- - match : (`+)(?!`)
2843+ - match : (?=`+)
2844+ branch_point : code-spans
2845+ branch :
2846+ - code-span
2847+ - no-code-span
2848+
2849+ code-span :
2850+ - match : (`+)
28252851 scope : punctuation.definition.raw.begin.markdown
2826- push : code-span-body
2852+ set : code-span-body
28272853
28282854 code-span-body :
28292855 - meta_scope : markup.raw.inline.markdown
28302856 - match : \1(?!`)
28312857 scope : punctuation.definition.raw.end.markdown
28322858 pop : 1
2833- - match : ' `+'
2834- - match : ^\s*$\n?
2835- scope : invalid.illegal.non-terminated.raw.markdown
2859+ - match : \`+
2860+ - match : ' {{list_paragraph_end}}'
2861+ fail : code-spans
2862+
2863+ no-code-span :
2864+ - match : \`+
28362865 pop : 1
2837- - include : paragraph-end
28382866
28392867# ##[ INLINE: EMPHASIS ]#######################################################
28402868
@@ -3429,6 +3457,7 @@ contexts:
34293457 scope : invalid.illegal.attribute-name.markdown
34303458
34313459 tag-attr-meta :
3460+ - meta_include_prototype : false
34323461 - meta_scope : meta.attribute-with-value.markdown
34333462 - include : immediately-pop
34343463
@@ -3506,6 +3535,7 @@ contexts:
35063535 - link-url-scheme-separator
35073536 # Github Flavoured Markdown
35083537 # After a valid domain, zero or more non-space non-< characters may follow
3538+ # https://github.github.com/gfm/#autolinks-extension-
35093539 - match : (?:(?:https|http|ftp)(://)|www\.)[\w-]+
35103540 captures :
35113541 1 : punctuation.separator.path.markdown
@@ -3534,14 +3564,15 @@ contexts:
35343564 # 3. Trailing punctuation (specifically, ?, !, ., ,, :, *, _, and ~) will not
35353565 # be considered part of the autolink, though they may be included in the
35363566 # interior # of the link
3537- - match : (?=(?:\)|(?:{{html_entity}})*)[?!.,:*_~]*[\s<])
3567+ # Note: contains some empirical (undocumented) punctuation such as ;, ', "
3568+ - match : (?=(?:\)|(?:{{html_entity}})*)[?!.,:;*_~'"]*[\s<])
35383569 pop : 1
35393570 - include : autolink-inet-common
35403571
35413572 autolink-inet-group :
35423573 - match : \)
3543- pop : 1
3544- - match : (?=(?:{{html_entity}})*[?!.,:*_~]*[\s<])
3574+ pop : true
3575+ - match : (?=(?:{{html_entity}})*[?!.,:; *_~'" ]*[\s<])
35453576 pop : 1
35463577 - include : autolink-inet-common
35473578
0 commit comments