From 314d2ea326c10fe63c20655db16c51744a63ed79 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sun, 12 Dec 2021 17:56:08 +0100 Subject: [PATCH 01/63] Docs: Update known bugs --- docs/troubleshooting.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index bacaa6e4..4d6a554a 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -27,7 +27,7 @@ To clean up or restore syntax specific settings... a) To clean up, remove no longer needed overrides. b) To restore, paste desired settings from following code block. -```json +```jsonc { "color_scheme": "MarkdownEditor.sublime-color-scheme", "tab_size": 4, @@ -126,7 +126,8 @@ When you notice any undesired behaviour introduced by the latest update, your fe ## Known Bugs -* Setext-style headers (`===` and `---`) do not show up in the symbol list. This is due to a Sublime Text limitation (see [#158][]). However, we are able to put a placeholder to indicate the existence of the header. We encourage you to use Atx-style headers (`#`). +* Setext-style headers (`===` and `---`) show up in the symbol list of Sublime Text 4 only. + They are not supported by Sublime Text 3 (see [#158][]). * Installing for the first time while having markdown files opened may cause MarkdownEditing to behave unexpectedly on those files. Close and reopen those files to fix it. From 43e2d56d4a269f8d8463128ca909bd400dc8f518 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Thu, 23 Dec 2021 15:48:49 +0100 Subject: [PATCH 02/63] Syntax: Update strikethough markup to use 2 tildes Fixes #637 This commit applies strikethrough pattern matching from https://github.github.com/gfm/#strikethrough-extension- Even though the GFM parser still renders text wrapped in one or two tildes as strikethrough (maybe for backward compatibility), the specification, which is based on CommonMark, asks to use two of them. --- messages/3.1.1.md | 1 + syntaxes/Markdown.sublime-syntax | 7 +++- tests/syntax_test_markdown.md | 70 +++++++++++++++++++++++++++----- 3 files changed, 65 insertions(+), 13 deletions(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index 0da01c0f..53a9807e 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -6,6 +6,7 @@ feedback you can use [GitHub issues][issues]. ## Bug Fixes * fix regression with latex block highlighting in list items +* update strikethough markup to use 2 tildes (fixes #637) ## New Features diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 33ec44ed..e68bfc48 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -2460,15 +2460,18 @@ contexts: - include: strikethrough strikethrough: - - match: (?:~(?!~}|>|\s))+ # any number of ~ up to ~> or ~~} critic markers + # https://github.github.com/gfm/#strikethrough-extension- + - match: ~~(?![~}>\s]) # 2x ~ but no ~> or ~~} scope: punctuation.definition.strikethrough.begin.markdown push: strikethrough-content + - match: ~+(?![~}>\s]) # any number of ~ not looking like ~> or ~~} strikethrough-content: - meta_scope: markup.strikethrough.markdown-gfm - - match: (?:~(?!~}|>))+ # any number of ~ up to ~> or ~~} critic markers + - match: ~~(?:(?!~)|(?=~~}|~>)) # 2x ~ maybe followed by ~> or ~~} scope: punctuation.definition.strikethrough.end.markdown pop: true + - match: ~+(?:(?!~)|(?=~~}|~>)) # any number of ~ maybe followed by ~> or ~~} - include: emphasis-common - include: bold - include: italic diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 274d5e0d..74c7a1d2 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -2003,19 +2003,25 @@ ___~~bold italic striked~~___ | ^^ punctuation.definition.bold.end.markdown ~Hi~ Hello, world! -| <- punctuation.definition.strikethrough.begin -|^^^ meta.paragraph markup.strikethrough -| ^ punctuation.definition.strikethrough.end -| ^^^^^^^^^^^^^^^ meta.paragraph - markup +| <- - punctuation.definition.strikethrough +|^^^^^^^^^^^^^^^^^ meta.paragraph - markup +| ^ - punctuation.definition.strikethrough This ~text~~~~ is ~~~~curious~. -| ^^^^^^^^^ meta.paragraph markup.strikethrough -| ^^^^^^^^^^^^ meta.paragraph markup.strikethrough -| ^^ meta.paragraph - markup -| ^ punctuation.definition.strikethrough.begin -| ^^^^ punctuation.definition.strikethrough.end -| ^^^^ punctuation.definition.strikethrough.begin -| ^ punctuation.definition.strikethrough.end +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - markup +| ^ - punctuation.definition.strikethrough +| ^^^^ - punctuation.definition.strikethrough +| ^^^^ - punctuation.definition.strikethrough +| ^ - punctuation.definition.strikethrough + +This ~~text~~~~ is ~~~~curious~~. +|^^^^ meta.paragraph - markup +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph markup.strikethrough +| ^^ meta.paragraph - markup +| ^^ punctuation.definition.strikethrough.begin +| ^^^^ - punctuation.definition.strikethrough +| ^^^^ - punctuation.definition.strikethrough +| ^^ punctuation.definition.strikethrough.end This ~~has a | ^^^^^^^^ meta.paragraph markup.strikethrough @@ -3188,6 +3194,48 @@ This is a {-- deletion --} and {~~substitute~>with~~striked~~text~~} or {~~~~old | ^^ punctuation.definition.strikethrough.end.markdown | ^^^ punctuation.definition.critic.end.markdown +No striked {~~~>~~} critics. +| ^^^^^^^^ markup.critic.substitution.markdown +| ^^^ punctuation.definition.critic.begin.markdown +| ^^ punctuation.separator.critic.markdown +| ^^^ punctuation.definition.critic.end.markdown +| ^^^^^^^^^^ - markup.critic + +No striked {~~~~>~~~} critics. +| ^^^^^^^^^^ markup.critic.substitution.markdown +| ^^^ punctuation.definition.critic.begin.markdown +| ^ - punctuation +| ^^ punctuation.separator.critic.markdown +| ^ - punctuation +| ^^^ punctuation.definition.critic.end.markdown +| ^^^^^^^^^^ - markup.critic + +No striked {~~~~~>~~~~} critics. +| ^^^^^^^^^^^^ markup.critic.substitution.markdown +| ^^^ punctuation.definition.critic.begin.markdown +| ^^ - punctuation +| ^^ punctuation.separator.critic.markdown +| ^^ - punctuation +| ^^^ punctuation.definition.critic.end.markdown +| ^^^^^^^^^^ - markup.critic + +No striked {~~~~~~>~~~~~} critics. +| ^^^^^^^^^^^^^^ markup.critic.substitution.markdown +| ^^^ punctuation.definition.critic.begin.markdown +| ^^^ - punctuation +| ^^ punctuation.separator.critic.markdown +| ^^^ - punctuation +| ^^^ punctuation.definition.critic.end.markdown +| ^^^^^^^^^^ - markup.critic + +No striked {~~~~~~~>~~~~~~} critics. +| ^^^^^^^^^^^^^^^^ markup.critic.substitution.markdown +| ^^^ punctuation.definition.critic.begin.markdown +| ^^^^ - punctuation +| ^^ punctuation.separator.critic.markdown +| ^^^^ - punctuation +| ^^^ punctuation.definition.critic.end.markdown +| ^^^^^^^^^^ - markup.critic This is a {>> comment <<}. | ^^^^^^^^^^^^^^^ markup.critic.comment.markdown From 40930c64246c37a289d60d7be536a93385aab88e Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Fri, 24 Dec 2021 14:24:33 +0100 Subject: [PATCH 03/63] Syntax: add full xonsh support in fenced code blocks This commit replaces source.python with source.xonsh since now there is a dedicated xonsh syntax package. --- messages/3.1.1.md | 3 +++ syntaxes/Markdown.sublime-syntax | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index 53a9807e..5a55d867 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -12,4 +12,7 @@ feedback you can use [GitHub issues][issues]. ## Changes +* Fully support xonsh fenced code instead of using Python syntax + (if supported syntax is installed) + [issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index e68bfc48..1f83e07d 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -1941,7 +1941,7 @@ contexts: 0: meta.code-fence.definition.begin.xonsh.markdown-gfm 2: punctuation.definition.raw.code-fence.begin.markdown 5: constant.other.language-name.markdown - embed: scope:source.python + embed: scope:source.xonsh embed_scope: markup.raw.code-fence.xonsh.markdown-gfm escape: '{{fenced_code_block_escape}}' escape_captures: From a222c067180b5b167edb63af6ea3588632dbb8b3 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Fri, 24 Dec 2021 14:31:31 +0100 Subject: [PATCH 04/63] Syntax: Fix CommonMark compatibility of fenced code blocks This commit fixes an incompatibility with CommonMark's specification of fenced code blocks wrapped into tildes. According to https://spec.commonmark.org/0.30/#example-146 the info string of a fenced code block started by tildes may contain further tildes and backticks. --- messages/3.1.1.md | 1 + syntaxes/Markdown.sublime-syntax | 1 - tests/syntax_test_markdown.md | 18 +++++++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index 5a55d867..adedf48e 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -6,6 +6,7 @@ feedback you can use [GitHub issues][issues]. ## Bug Fixes * fix regression with latex block highlighting in list items +* fix CommonMark compatibility of fenced code blocks * update strikethough markup to use 2 tildes (fixes #637) ## New Features diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 1f83e07d..d742f976 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -118,7 +118,6 @@ variables: (?![^`]*`) # not followed by any more backticks on the same line | # or (~){3,} # 3 or more tildas - (?![^~]*~) # not followed by any more tildas on the same line ) \s* # allow for whitespace between code block start and info string ) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 74c7a1d2..b9f5b0df 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -2183,7 +2183,11 @@ http://spec.commonmark.org/0.28/#example-318 | ^^^ punctuation.definition.raw.code-fence.end ~~~~~test~ -| ^^^^^^^^^ meta.paragraph - constant - markup.raw +|^^^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^^^^ meta.code-fence.definition.begin.text.markdown-gfm constant.other.language-name.markdown + +~~~~~ +|^^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown ~~~~~~test | ^^^^ punctuation.definition.raw.code-fence.begin @@ -2191,6 +2195,18 @@ http://spec.commonmark.org/0.28/#example-318 ~~~~~~ | ^^^^ punctuation.definition.raw.code-fence.end +# https://spec.commonmark.org/0.30/#example-146 + +~~~ aa ``` ~~~ +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^ meta.code-fence.definition.begin.text.markdown-gfm constant.other.language-name.markdown +| ^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +foo +~~~ +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + ```test | ^^^^ constant.other.language-name ``` From 468bcd1c79a079bc5df48ce9298111c94b3a8867 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sun, 26 Dec 2021 15:41:29 +0100 Subject: [PATCH 05/63] Syntax: Fix CommonMark compatibility of indented code blocks Indentation may consist of mixed spaces and tabs, which form a visual indentation of 4 spaces. A tab is interpreted with tabwith=4 --- messages/3.1.1.md | 1 + syntaxes/Markdown.sublime-syntax | 2 +- tests/syntax_test_markdown.md | 86 ++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index adedf48e..606da168 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -7,6 +7,7 @@ feedback you can use [GitHub issues][issues]. * fix regression with latex block highlighting in list items * fix CommonMark compatibility of fenced code blocks +* fix CommonMark compatibility of indented code blocks (mixed tabs/spaces) * update strikethough markup to use 2 tildes (fixes #637) ## New Features diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index d742f976..8a886bf9 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -25,7 +25,7 @@ variables: setext_escape: ^(?=[ ]{,3}(?:=+|-+)\s*$) # between 0 and 3 spaces, followed by at least one hyphon or equal sign (setext underline can be of any length) block_quote: (?:[ ]{,3}(>)[ ]?) # between 0 and 3 spaces, followed by a greater than sign, (followed by any character or the end of the line = "only care about optional space!") - indented_code_block: (?:[ ]{4}|\t) # 4 spaces or a tab + indented_code_block: (?:[ ]{4}|[ ]{0,3}\t) # a visual tab of width 4 consisting of 4 spaces or 0 to 3 spaces followed by 1 tab list_item: (?:[ ]{,3}(?:\d+[.)]|[*+-])\s) # between 0 and 3 spaces, followed by either: at least one integer and a full stop or a parenthesis, or (a star, plus or dash), followed by whitespace thematic_break: |- (?x: diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index b9f5b0df..33a5fcdd 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1,5 +1,91 @@ | SYNTAX TEST "Packages/MarkdownEditing/syntaxes/Markdown.sublime-syntax" +# TEST: Tabs ################################################################## + +## https://spec.commonmark.org/0.30/#example-1 + + foo baz bim +| <- markup.raw.block.markdown +|^^^^^^^^^^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-2 + + foo baz bim +| <- markup.raw.block.markdown +|^^^^^^^^^^^^^ markup.raw.block.markdown + + foo baz bim +| <- markup.raw.block.markdown +|^^^^^^^^^^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-3 + + a a + ὐ a +| <- markup.raw.block.markdown +|^^^^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-4 + + - foo + + bar +| <- markup.list.unnumbered.markdown +|^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown + +## https://spec.commonmark.org/0.30/#example-5 + +- foo + + bar +| <- markup.list.unnumbered.markdown markup.raw.block.markdown +|^^^^^ markup.list.unnumbered.markdown markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-6 + +> foo +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^^ markup.quote.markdown markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-7 + +- foo +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown + + +## https://spec.commonmark.org/0.30/#example-8 + + foo + bar +| <- markup.raw.block.markdown +|^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-9 + + - foo + - bar + - baz +|^ markup.list.unnumbered.markdown meta.paragraph.list.markdown +| ^ markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown + +## https://spec.commonmark.org/0.30/#example-10 + +# Foo +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.1.markdown - punctuation + +## https://spec.commonmark.org/0.30/#example-11 + +* * * +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^ meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown + + +# TEST: ATX HEADINGS ########################################################## + # Heading | <- markup.heading.1 punctuation.definition.heading |^^^^^^^^^ markup.heading.1.markdown From 0a7b2e46749ff102a2954bd3d1068e19c9d97730 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 25 Dec 2021 10:43:07 +0100 Subject: [PATCH 06/63] Syntax: Update test section separators --- tests/syntax_test_markdown.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 33a5fcdd..f55ee9cc 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -667,7 +667,7 @@ non-disabled markdown | <- - meta.disable-markdown -# Block Quote Tests ########################################################### +# TEST: BLOCK QUOTES ########################################################## >= | <- punctuation.definition.blockquote.markdown @@ -835,6 +835,9 @@ no code block - - - | <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote + +# TEST: INDENTED CODE BLOCKS ################################################## + Code block below: this is code! @@ -847,6 +850,9 @@ Code block below: paragraph | <- meta.paragraph + +# TEST: THEMATIC BREAKS ####################################################### + - - - - | ^^^^^^ meta.separator | ^ punctuation.definition.thematic-break @@ -868,7 +874,8 @@ _ _ _ _ _ _ _ | ^ punctuation | ^ punctuation -###[ COMMONMARK AUTOLINKS ]################################################### + +# TEST: COMMONMARK AUTOLINKS ################################################## | <- meta.link.email.markdown punctuation.definition.link.begin.markdown - markup.underline @@ -957,7 +964,8 @@ _ _ _ _ _ _ _ | ^^^ punctuation.separator.path.markdown | ^ punctuation.separator.path.markdown -###[ GFM AUTOLINKS ]########################################################## + +# TEST: GFM AUTOLINKS ######################################################### Visit ftp://intra%20net | ^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link @@ -1111,7 +1119,8 @@ a.b-c_d@a.b. | <- - meta.link - markup.underline |^^^^^^^^^^^^^ - meta.link - markup.underline.link -###[ LIGATURES ]############################################################## + +# TEST: LIGATURES ############################################################# this is a raw ampersand & does not require HTML escaping | ^ - entity - illegal @@ -2022,7 +2031,7 @@ __test!*test__ Issue 1163 | ^ - punctuation.definition.italic | ^^ punctuation.definition.bold.end -# Strikethrough Tests +# TEST: STRIKETHROUGH ######################################################### __~~bold striked~~__ | <- markup.bold.markdown punctuation.definition.bold.begin.markdown @@ -2119,7 +2128,7 @@ new paragraph~~. | <- invalid.illegal.non-terminated.bold-italic -# Fenced Code Block Tests +# TEST: FENCED CODE BLOCKS #################################################### Paragraph is terminated by fenced code blocks. ``` @@ -3233,7 +3242,7 @@ This is literal [Foo*bar\]] but [ref][Foo*bar\]] | ^ punctuation.definition.link.begin | ^ punctuation.definition.link.end -# CriticMarkup ################################################################ +# TEST: CRITIC MARKUP ######################################################### This is an {++additional++} word in {++**bold**++}. | ^^^^^^^^^^^^^^^^ markup.critic.addition.markdown From 5aa093fca878373d51335a59d1489f6c68bf1fb7 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 25 Dec 2021 12:07:55 +0100 Subject: [PATCH 07/63] Syntax: Fix CommonMark compatibility of thematic breaks Thematic breaks may contain any number of spaces or tabs. --- messages/3.1.1.md | 1 + syntaxes/Markdown.sublime-syntax | 6 +- tests/syntax_test_markdown.md | 340 ++++++++++++++++++++++++++++--- 3 files changed, 320 insertions(+), 27 deletions(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index 606da168..481f8fce 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -8,6 +8,7 @@ feedback you can use [GitHub issues][issues]. * fix regression with latex block highlighting in list items * fix CommonMark compatibility of fenced code blocks * fix CommonMark compatibility of indented code blocks (mixed tabs/spaces) +* fix CommonMark compatibility of thematic breaks * update strikethough markup to use 2 tildes (fixes #637) ## New Features diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 8a886bf9..91601060 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -31,9 +31,9 @@ variables: (?x: [ ]{,3} # between 0 to 3 spaces (?: # followed by one of the following: - [-](?:[ ]{,2}[-]){2,} # - a dash, followed by the following at least twice: between 0 to 2 spaces followed by a dash - | [*](?:[ ]{,2}[*]){2,} # - a star, followed by the following at least twice: between 0 to 2 spaces followed by a star - | [_](?:[ ]{,2}[_]){2,} # - an underscore, followed by the following at least twice: between 0 to 2 spaces followed by an underscore + [-](?:[ \t]*[-]){2,} # - a dash, followed by the following at least twice: any number of spaces or tabs followed by a dash + | [*](?:[ \t]*[*]){2,} # - a star, followed by the following at least twice: any number of spaces or tabs followed by a star + | [_](?:[ \t]*[_]){2,} # - an underscore, followed by the following at least twice: any number of spaces or tabs followed by an underscore ) [ \t]*$ # followed by any number of tabs or spaces, followed by the end of the line ) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index f55ee9cc..977d0eaf 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -589,18 +589,6 @@ Paragraph break. |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote | ^^^^^^^^^ markup.italic -Paragraph break. - ---- -|^^^ meta.separator.thematic-break -|^^ punctuation.definition.thematic-break - -Paragraph break. - --------- -|^^^^^^^^ meta.separator.thematic-break -|^^^^^^^ punctuation.definition.thematic-break - [1]: https://google.com | <- meta.link.reference.def.markdown |^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown @@ -853,26 +841,330 @@ paragraph # TEST: THEMATIC BREAKS ####################################################### -- - - - -| ^^^^^^ meta.separator +## https://spec.commonmark.org/0.30/#example-11 + +* * * +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^ meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown + +- - - +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^ meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown + +_ _ _ +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^ meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown + +## https://spec.commonmark.org/0.30/#example-43 + +*** +|^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown + +--- +|^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown + +___ +|^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown + +## https://spec.commonmark.org/0.30/#example-44 + ++++ +| <- - meta.separator +|^^^ - meta.separator + +## https://spec.commonmark.org/0.30/#example-45 + +=== +| <- - meta.separator +|^^^ - meta.separator + +## https://spec.commonmark.org/0.30/#example-46 + +** +| <- - meta.separator +|^ - meta.separator + +-- +| <- - meta.separator +|^ - meta.separator + +__ +| <- - meta.separator +|^ - meta.separator + +## https://spec.commonmark.org/0.30/#example-47 + + *** +|<- meta.separator.thematic-break.markdown - punctuation +|^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown + + *** +|<- meta.separator.thematic-break.markdown - punctuation +|^ meta.separator.thematic-break.markdown - punctuation +| ^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown + + *** +|<- meta.separator.thematic-break.markdown - punctuation +|^^ meta.separator.thematic-break.markdown - punctuation +| ^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown + +## https://spec.commonmark.org/0.30/#example-48 + + *** +|<- markup.raw.block.markdown +|^^^^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-49 + +Foo + *** +| <- meta.paragraph.markdown +|^^^^^^^ meta.paragraph.markdown + +## https://spec.commonmark.org/0.30/#example-50 + +************************************** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown + +-------------------------------------- +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown + +_____________________________________ +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown + +## https://spec.commonmark.org/0.30/#example-51 + + * * * +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^ meta.separator.thematic-break.markdown +|^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation + + - - - +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^ meta.separator.thematic-break.markdown +|^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation + + _ _ _ +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^ meta.separator.thematic-break.markdown +|^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation + +## https://spec.commonmark.org/0.30/#example-52 + + ** * ** * ** * ** +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown +| ^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation + + -- - -- - -- - -- +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown +| ^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation + + __ _ __ _ __ _ __ +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown +| ^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation + +## https://spec.commonmark.org/0.30/#example-53 + +* * * * +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation + +- - - - +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation + +_ _ _ _ +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation + +## https://spec.commonmark.org/0.30/#example-54 + +* * * * +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^ meta.separator.thematic-break.markdown +|^ - punctuation | ^ punctuation.definition.thematic-break +| ^ - punctuation | ^ punctuation.definition.thematic-break +| ^ - punctuation | ^ punctuation.definition.thematic-break -| ^ - punctuation -* * * * * -| ^^^^^^^^ meta.separator +| ^ - punctuation -_ _ _ _ _ _ _ -| ^^^^^^^^^^^^ meta.separator +- - - - +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^ meta.separator.thematic-break.markdown +|^ - punctuation | ^ punctuation.definition.thematic-break +| ^ - punctuation | ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation + +_ _ _ _ +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^ meta.separator.thematic-break.markdown +|^ - punctuation +| ^ punctuation.definition.thematic-break | ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation + +## https://spec.commonmark.org/0.30/#example-55 + +_ _ _ _ a +| <- meta.paragraph.markdown - meta.separator +|^^^^^^^^^ meta.paragraph.markdown - meta.separator + +a------ +| <- meta.paragraph.markdown - meta.separator +|^^^^^^^ meta.paragraph.markdown - meta.separator + +---a--- +| <- meta.paragraph.markdown - meta.separator +|^^^^^^^ meta.paragraph.markdown - meta.separator + +## https://spec.commonmark.org/0.30/#example-56 + + *-* +| <- meta.paragraph.markdown - meta.separator +|^^^ meta.paragraph.markdown - meta.separator + +## https://spec.commonmark.org/0.30/#example-57 + +- foo +*** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +- bar +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown + +## https://spec.commonmark.org/0.30/#example-58 + +Foo +*** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +bar +| <- meta.paragraph.markdown + +## https://spec.commonmark.org/0.30/#example-59 + +Foo +--- +| <- markup.heading.2.setext.markdown punctuation.definition.heading.setext.markdown +|^^ markup.heading.2.setext.markdown punctuation.definition.heading.setext.markdown +bar +| <- meta.paragraph.markdown + +## https://spec.commonmark.org/0.30/#example-60 + +* Foo +* * * +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^ meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +* Bar +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown + +## https://spec.commonmark.org/0.30/#example-61 -- - - - -| <- meta.separator.thematic-break punctuation.definition.thematic-break -|^^ - punctuation -| ^ punctuation -| ^ punctuation +- Foo +- * * * +| ^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.separator.thematic-break.markdown # TEST: COMMONMARK AUTOLINKS ################################################## From 3249dc72db854dfbd351b4238b448b0c020c7d2c Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sun, 26 Dec 2021 15:20:54 +0100 Subject: [PATCH 08/63] Syntax: Fix CommonMark compatibility of backslash escapes This commit applies https://spec.commonmark.org/0.30/#backslash-escapes 1. All characters can be escaped. 2. Usage of former `{{escape}}` in `balance_square_brackets` etc. is fixed by correctly grouping the escape pattern `(?:\\.)+`. 3. Various CommonMark tests are added. --- messages/3.1.1.md | 1 + syntaxes/Markdown.sublime-syntax | 12 ++- tests/syntax_test_markdown.md | 151 ++++++++++++++++++++++++++++--- 3 files changed, 146 insertions(+), 18 deletions(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index 481f8fce..f190c3ca 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -6,6 +6,7 @@ feedback you can use [GitHub issues][issues]. ## Bug Fixes * fix regression with latex block highlighting in list items +* fix CommonMark compatibility of backslash escapes * fix CommonMark compatibility of fenced code blocks * fix CommonMark compatibility of indented code blocks (mixed tabs/spaces) * fix CommonMark compatibility of thematic breaks diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 91601060..4c32632c 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -45,12 +45,12 @@ variables: | (`{2})(?![\s`])(?:[^`]+(?=`)|(?!`{2})`+(?!`))+(`{2})(?!`) # 2 backticks, followed by at least one non whitespace, non backtick character, followed by (less than 2 backticks, or at least one non backtick character) at least once, followed by exactly 2 backticks | (`{1})(?![\s`])(?:[^`]+(?=`)|(?!`{1})`+(?!`))+(`{1})(?!`) # 1 backtick, followed by at least one non whitespace, non backtick character, followed by ( at least one non backtick character) at least once, followed by exactly 1 backtick ) - escape: \\[-`*_#+.!(){}\[\]\\>|~<] + escapes: \\[-+*/!"#$%&'(),.:;<=>?@\[\\\]^_`{|}~] balance_square_brackets: |- (?x: (?: - {{escape}}+ # escape characters + (?:{{escapes}})+ # escape characters | [^\[\]`\\]+(?=[\[\]`\\]|$) # anything that isn't a square bracket or a backtick or the start of an escape character | {{backticks}} # inline code | \[(?: # nested square brackets (one level deep) @@ -62,7 +62,7 @@ variables: balance_square_brackets_and_emphasis: |- (?x: (?: - {{escape}}+ # escape characters + (?:{{escapes}})+ # escape characters | [^\[\]`\\_*]+(?=[\[\]`\\_*]|$) # anything that isn't a square bracket, a backtick, the start of an escape character, or an emphasis character | {{backticks}} # inline code | \[(?: # nested square brackets (one level deep) @@ -74,7 +74,7 @@ variables: balance_square_brackets_pipes_and_emphasis: |- (?x: (?: - {{escape}}+ # escape characters + (?:{{escapes}})+ # escape characters | [^\[\]`\\_*|]+(?=[\[\]`\\_*|]|$) # anything that isn't a square bracket, a backtick, the start of an escape character, or an emphasis character | {{backticks}} # inline code | \[(?: # nested square brackets (one level deep) @@ -2787,6 +2787,7 @@ contexts: - match: ^\s*$\n? scope: invalid.illegal.non-terminated.link-title.markdown pop: true + - include: escapes link-url-angled: - match: \> @@ -2979,7 +2980,8 @@ contexts: ###[ INLINE: OTHER ]########################################################## escapes: - - match: '{{escape}}' + # https://spec.commonmark.org/0.30/#backslash-escapes + - match: '{{escapes}}' scope: constant.character.escape.markdown hard-line-breaks: diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 977d0eaf..c7a43ba3 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -84,6 +84,144 @@ | ^ punctuation.definition.thematic-break.markdown +# TEST: BACKSLASH ESCAPES ##################################################### + +## https://spec.commonmark.org/0.30/#example-12 + +\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ +| <- constant.character.escape.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.character.escape.markdown + +## https://spec.commonmark.org/0.30/#example-13 + +\ \A\a\ \3\φ\« +| <- - constant.character.escape +|^^^^^^^^^^^^^ - constant.character.escape + +## https://spec.commonmark.org/0.30/#example-14 + +\*not emphasized* +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^^^^^ - markup.italic + +\
not a tag +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^ - markup.tag + +\
not a tag +| <- constant.character.escape.markdown +|^^^^^^ - meta.tag +| ^^ constant.character.escape + +\[not a link](/foo) +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^^^^^^^ - markup.link + +\`not code` +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^ - markup.raw + +1\. not a list +|^^ constant.character.escape.markdown +|^^^^^^^^^^^^^ - markup.list + +\* not a list +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^ - markup.list + +\# not a heading +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^^^^ - markup.heading + +\[foo]: /url "not a reference" +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.link + +\ö not a character entity +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^ - entity + +\~/.bashrc +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown + +## https://spec.commonmark.org/0.30/#example-15 + +\\*emphasis* +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +| ^^^^^^^^^^ markup.italic.markdown + +\\_emphasis_ +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +| ^^^^^^^^^^ markup.italic.markdown + +## https://spec.commonmark.org/0.30/#example-16 + +foo\ +| ^ meta.hard-line-break.markdown constant.character.escape.markdown +| ^ meta.hard-line-break.markdown - constant +bar + +## https://spec.commonmark.org/0.30/#example-17 + +`` \[\` `` +|^^^^^^^^^ markup.raw.inline.markdown - constant.character.escape + +## https://spec.commonmark.org/0.30/#example-18 + + \[\] +|^^^^^^^^ markup.raw.block.markdown - constant.character.escape + +## https://spec.commonmark.org/0.30/#example-19 + +~~~ +\[\] +|^^^^ markup.raw.code-fence.markdown-gfm - constant.character.escape +~~~ + +## https://spec.commonmark.org/0.30/#example-20 + + +| ^^ - constant.character.escape + +## https://spec.commonmark.org/0.30/#example-21 + + +| ^^ - constant.character.escape + +## https://spec.commonmark.org/0.30/#example-22 + +[foo](/bar\* "ti\*tle") +| ^^ markup.underline.link.markdown constant.character.escape +| ^^ constant.character.escape + +## https://spec.commonmark.org/0.30/#example-23 + +[foo] + +[foo]: /bar\* "ti\*tle" +| ^^ markup.underline.link.markdown constant.character.escape +| ^^ constant.character.escape + +## https://spec.commonmark.org/0.30/#example-24 + +Note: current design doesn't support highlighting escapes in info strings +``` foo\+bar +| ^^ - constant.character.escape +foo +``` + + # TEST: ATX HEADINGS ########################################################## # Heading @@ -3450,9 +3588,6 @@ end ~~~~~~~ | <- meta.code-fence.definition.end.ruby punctuation.definition.raw.code-fence.end -\~/.bashrc -|^ constant.character.escape - -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable @@ -3466,16 +3601,6 @@ end | ^ markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable -\
-|<- constant.character.escape -|^ constant.character.escape -|^^^^^^ - meta.tag - -\ -|^ constant.character.escape -|^^^^^^ - meta.tag -| ^^ constant.character.escape - link with a single underscore inside the text : [@_test](http://example.com) | ^^^^^^ meta.paragraph meta.link.inline.description - punctuation.definition | ^ meta.paragraph meta.link.inline punctuation.definition.link.end From 3dc7c54a03b4796daedddab7fee8ad99e02ee93f Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sun, 26 Dec 2021 15:24:13 +0100 Subject: [PATCH 09/63] Syntax: Tweak heading tests formatting --- tests/syntax_test_markdown.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index c7a43ba3..c71c9860 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -253,11 +253,13 @@ https://spec.commonmark.org/0.30/#example-71 | ^^^^ - entity.name.section https://spec.commonmark.org/0.30/#example-73 + ## Example 73 (trailing spaces!) ##### | ^ punctuation.definition.heading.end.markdown | ^ meta.whitespace.newline.markdown https://spec.commonmark.org/0.30/#example-74 + ## Example 74 #### > |^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.2.markdown |^^ - entity.name.section @@ -265,6 +267,7 @@ https://spec.commonmark.org/0.30/#example-74 | ^ - entity.name.section https://spec.commonmark.org/0.30/#example-75 + # #heading# # | <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown |^^^^^^^^^^^^^ markup.heading.1.markdown @@ -274,6 +277,7 @@ https://spec.commonmark.org/0.30/#example-75 | ^ punctuation.definition.heading.end.markdown https://spec.commonmark.org/0.30/#example-76 + ## heading \## | <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown |^^^^^^^^^^^^^^ markup.heading.2.markdown @@ -284,6 +288,7 @@ https://spec.commonmark.org/0.30/#example-76 | ^ - entity.name.section https://spec.commonmark.org/0.30/#example-79 + # | <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown From a0f3f787cac76fb7789c83e2beeede83deaaa0f8 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Mon, 27 Dec 2021 12:01:32 +0100 Subject: [PATCH 10/63] Syntax: Fix CommonMark compatibility of html entities see: https://spec.commonmark.org/0.30/#entity-and-numeric-character-references --- messages/3.1.1.md | 1 + syntaxes/Markdown.sublime-syntax | 9 +- tests/syntax_test_markdown.md | 175 +++++++++++++++++++++++++++++++ 3 files changed, 183 insertions(+), 2 deletions(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index f190c3ca..d4047899 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -7,6 +7,7 @@ feedback you can use [GitHub issues][issues]. * fix regression with latex block highlighting in list items * fix CommonMark compatibility of backslash escapes +* fix CommonMark compatibility of html entities * fix CommonMark compatibility of fenced code blocks * fix CommonMark compatibility of indented code blocks (mixed tabs/spaces) * fix CommonMark compatibility of thematic breaks diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 4c32632c..16f3efcb 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -206,7 +206,7 @@ variables: html_tag_break_char: (?:[ \t>]|$) html_tag_maybe_selfclosing_break_char: (?:[ \t]|/?>|$) - html_entity: '&([a-zA-Z0-9]+|#\d+|#x\h+);' + html_entity: '&([a-zA-Z0-9]+|#\d+|#[Xx]\h+);' ascii_space: '\t\n\f ' tag_attribute_name_start: (?=[^{{ascii_space}}=/>}]) @@ -2040,6 +2040,10 @@ contexts: html-content: - include: scope:text.html.basic + html-entities: + # https://spec.commonmark.org/0.30/#entity-and-numeric-character-references + - include: scope:text.html.basic#entities + html-kbd-tags: # A simple implementation to add dedicated `markup.kbd` scopes. # Note: Doesn't (intent to) support bold/italic/striked content. @@ -2246,7 +2250,6 @@ contexts: - match: '[<>]?(-+|=+)[<>]' - match: '<<+|<>|>>+' - match: <(?![A-Za-z/?!]) - - match: (?!{{html_entity}})& - include: html-kbd-tags - include: html-content @@ -2788,6 +2791,7 @@ contexts: scope: invalid.illegal.non-terminated.link-title.markdown pop: true - include: escapes + - include: html-entities link-url-angled: - match: \> @@ -2809,6 +2813,7 @@ contexts: link-url-common: - include: escapes + - include: html-entities - include: link-url-path-separators - include: link-url-scheme-separators - include: link-url-escapes diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index c71c9860..228beb83 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -222,6 +222,181 @@ foo ``` +# TEST: HTML ENTITIES ######################################################### + +## https://spec.commonmark.org/0.30/#example-25 + +   & © Æ Ď +| ^^^^^^ constant.character.entity.named.html +| ^ - constant +| ^^^^^ constant.character.entity.named.html +| ^ - constant +| ^^^^^^ constant.character.entity.named.html +| ^ - constant +| ^^^^^^^ constant.character.entity.named.html +| ^ - constant +| ^^^^^^^^ constant.character.entity.named.html +| ^ - constant + + ¾ ℋ ⅆ +| ^^^^^^^^ constant.character.entity.named.html +| ^ - constant +| ^^^^^^^^^^^^^^ constant.character.entity.named.html +| ^ - constant +| ^^^^^^^^^^^^^^^ constant.character.entity.named.html +| ^ - constant + + ∲ ≧̸ +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.character.entity.named.html +| ^ - constant +| ^^^^^ constant.character.entity.named.html +| ^ - constant + +## https://spec.commonmark.org/0.30/#example-26 + + # Ӓ Ϡ � +| ^^^^^ constant.character.entity.decimal.html +| ^ - constant +| ^^^^^^^ constant.character.entity.decimal.html +| ^ - constant +| ^^^^^^ constant.character.entity.decimal.html +| ^ - constant +| ^^^^ constant.character.entity.decimal.html +| ^ - constant + +## https://spec.commonmark.org/0.30/#example-27 + + " ആ ಫ +| ^^^^^^ constant.character.entity.hexadecimal.html +| ^ - constant +| ^^^^^^^ constant.character.entity.hexadecimal.html +| ^ - constant +| ^^^^^^^ constant.character.entity.hexadecimal.html +| ^ - constant + +## https://spec.commonmark.org/0.30/#example-28 + + & +| ^ - constant - invalid + +   &x; &#; &#x; +| ^^^^^^ - constant +| ^^^ constant.character.entity.named.html +| ^^^^^^^^^ - constant + + � + + &#abcdef0; +| ^^^^^^^^^^ - constant + + &hi?; +| ^^^^^ - constant + +Note: ST's HTML or Markdown don't maintain a full list of valid html5 entities + for simplicity reasons and therefore invalid entities are highlighted. + +## https://spec.commonmark.org/0.30/#example-29 + +Although HTML5 does accept some entity references without a trailing semicolon +(such as ©), these are not recognized here, because it makes the grammar +too ambiguous: + + © +| ^^^^^ - constant + +## https://spec.commonmark.org/0.30/#example-30 + +Strings that are not on the list of HTML5 named entities are not recognized as +entity references either: + + &MadeUpEntity; +| ^^^^^^^^^^^^^^ constant.character.entity.named.html + +Note: ST's HTML or Markdown don't maintain a full list of valid html5 entities + for simplicity reasons and therefore invalid entities are highlighted. + +## https://spec.commonmark.org/0.30/#example-31 + + +| ^^^^^^^^^^^^ constant.character.entity.named.html + +## https://spec.commonmark.org/0.30/#example-32 + +[foo](/föö "föö") +| ^^^^^^^^^^^^ constant.character.entity.named.html +| ^^^^^^^^^^^^ constant.character.entity.named.html + +## https://spec.commonmark.org/0.30/#example-33 + +[foo] + +[foo]: /föö "föö" +| ^^^^^^^^^^^^ constant.character.entity.named.html +| ^^^^^^^^^^^^ constant.character.entity.named.html + +## https://spec.commonmark.org/0.30/#example-34 + +``` föö +foo +``` +Note: current design doesn't support highlighting entities in info strings + +## https://spec.commonmark.org/0.30/#example-35 + +`föö` +|^^^^^^^^^^^^^ - constant.character.entity + +## https://spec.commonmark.org/0.30/#example-36 + + föfö +| ^^^^^^^^^^^^^^ - constant.character.entity + +## https://spec.commonmark.org/0.30/#example-37 + +*foo* +| <- meta.paragraph.markdown constant.character.entity.decimal.html +|^^^^^^^^^^^^^ meta.paragraph.markdown - markup.italic +|^^^^ constant.character.entity.decimal.html +| ^^^^^ constant.character.entity.decimal.html + +*foo* +| <- meta.paragraph.markdown markup.italic.markdown +|^^^^ meta.paragraph.markdown markup.italic.markdown + +## https://spec.commonmark.org/0.30/#example-38 + +* foo +| <- meta.paragraph.markdown constant.character.entity.decimal.html +|^^^^^^^^^ meta.paragraph.markdown +|^^^^ constant.character.entity.decimal.html + +* foo +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-39 + +foo bar +| <- meta.paragraph.markdown +|^^^^^^^^^^^^^^^^ meta.paragraph.markdown +| ^^^^^^^^^^ constant.character.entity.decimal.html + +## https://spec.commonmark.org/0.30/#example-40 + + foo +| <- meta.paragraph.markdown constant.character.entity.decimal.html +|^^^ meta.paragraph.markdown constant.character.entity.decimal.html +| ^^^^ meta.paragraph.markdown - constant + +## https://spec.commonmark.org/0.30/#example-41 + +[a](url "tit") +| ^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.link +| ^^^^^^ constant.character.entity.named.html +| ^^^ - constant +| ^^^^^^ constant.character.entity.named.html + + # TEST: ATX HEADINGS ########################################################## # Heading From fb93717aa3de5ceaee989513fc7c6d9788e4fc81 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Mon, 27 Dec 2021 14:34:44 +0100 Subject: [PATCH 11/63] Syntax: Add official CommonMark ATX heading tests This commit adds all ATX headings tests from spec.commonmark.org and partly replaces existing ones which target the same cases. --- tests/syntax_test_markdown.md | 314 ++++++++++++++++++++++++---------- 1 file changed, 225 insertions(+), 89 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 228beb83..339b28b9 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -399,70 +399,244 @@ foo bar # TEST: ATX HEADINGS ########################################################## -# Heading -| <- markup.heading.1 punctuation.definition.heading -|^^^^^^^^^ markup.heading.1.markdown -|^ - entity.name.section -| ^^^^^^ entity.name.section -| ^ meta.whitespace.newline.markdown - entity.name.section +## https://spec.commonmark.org/0.30/#example-62 -## Second Heading # -| <- markup.heading.2 punctuation.definition.heading -|^^^^^^^^^^^^^^^^^^^ markup.heading.2.markdown -|^^ - entity.name.section -| ^^^^^^^^^^^^^^ entity.name.section -| ^^ - entity.name.section -| ^ punctuation.definition.heading.end.markdown +# foo +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.1.markdown - punctuation -https://spec.commonmark.org/0.30/#example-71 +## foo +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown +|^ markup.heading.2.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.2.markdown - punctuation - ## Heading ## -|^^^^^^^^^^^^^^^ markup.heading.2.markdown -|^ - punctuation -| ^^ punctuation.definition.heading.begin.markdown -| ^^^^^^^^^ - punctuation -| ^^ punctuation.definition.heading.end.markdown -| ^ - punctuation -|^^^^ - entity.name.section -| ^^^^^^^ entity.name.section.markdown -| ^^^^ - entity.name.section +### foo +| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown +|^^ markup.heading.3.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.3.markdown - punctuation + +#### foo +| <- markup.heading.4.markdown punctuation.definition.heading.begin.markdown +|^^^ markup.heading.4.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.4.markdown - punctuation + +##### foo +| <- markup.heading.5.markdown punctuation.definition.heading.begin.markdown +|^^^^ markup.heading.5.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.5.markdown - punctuation + +###### foo +| <- markup.heading.6.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.6.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.6.markdown - punctuation + +## https://spec.commonmark.org/0.30/#example-63 + +####### foo +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^^^^^ meta.paragraph.markdown - markup.heading + +## https://spec.commonmark.org/0.30/#example-64 -https://spec.commonmark.org/0.30/#example-73 +#5 bolt +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^ meta.paragraph.markdown - markup.heading -## Example 73 (trailing spaces!) ##### -| ^ punctuation.definition.heading.end.markdown -| ^ meta.whitespace.newline.markdown +#hashtag +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^^ meta.paragraph.markdown - markup.heading -https://spec.commonmark.org/0.30/#example-74 +## https://spec.commonmark.org/0.30/#example-65 -## Example 74 #### > -|^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.2.markdown -|^^ - entity.name.section -| ^^^^^^^^^^^^^^^^^^^^ entity.name.section.markdown -| ^ - entity.name.section +\## foo +| <- meta.paragraph.markdown constant.character.escape.markdown - markup +|^ meta.paragraph.markdown constant.character.escape.markdown - markup +| ^^^^^^ meta.paragraph.markdown - constant - markup -https://spec.commonmark.org/0.30/#example-75 +## https://spec.commonmark.org/0.30/#example-66 -# #heading# # +# foo *bar* \*baz\* | <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^^^^^ markup.heading.1.markdown -|^ - entity.name.section -| ^^^^^^^^^ entity.name.section.markdown -| ^^ - entity.name.section -| ^ punctuation.definition.heading.end.markdown +|^ markup.heading.1.markdown - entity.name - markup.italic +| ^^^^ markup.heading.1.markdown entity.name.section.markdown - markup.italic +| ^^^^^ markup.heading.1.markdown entity.name.section.markdown markup.italic.markdown +| ^^^^^^^^ markup.heading.1.markdown entity.name.section.markdown - markup.italic + +## https://spec.commonmark.org/0.30/#example-67 + +# foo +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^^^^^^^ markup.heading.1.markdown - entity.name +| ^^^ markup.heading.1.markdown entity.name.section.markdown +| ^^^^^^^^^^^^^^^^^^^^^^ markup.heading.1.markdown - entity.name + +## https://spec.commonmark.org/0.30/#example-68 + + ### foo +| <- markup.heading.3.markdown +|^^^^^^^^ markup.heading.3.markdown + ## foo +| <- markup.heading.2.markdown +|^^^^^^^^ markup.heading.2.markdown + # foo +| <- markup.heading.1.markdown +|^^^^^^^^ markup.heading.1.markdown -https://spec.commonmark.org/0.30/#example-76 +## https://spec.commonmark.org/0.30/#example-69 -## heading \## + # foo +| <- markup.raw.block.markdown +|^^^^^^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-70 + +foo + # bar +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^^^ meta.paragraph.markdown - markup.heading + +## https://spec.commonmark.org/0.30/#example-71 + +## foo ## + ### bar ### +| <- markup.heading.3.markdown +|^^^^^^^^^^^^^^^^^^ markup.heading.3.markdown +| ^^^ punctuation.definition.heading.begin.markdown +| ^^^ - entity - punctuation +| ^^^ entity.name.section.markdown +| ^^^^ - entity - punctuation +| ^^^ punctuation.definition.heading.end.markdown +| ^ - punctuation + +## https://spec.commonmark.org/0.30/#example-72 + +# foo ################################## +##### foo ## +| <- markup.heading.5.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^ markup.heading.5.markdown +|^^^^ punctuation.definition.heading.begin.markdown +| ^ - entity - punctuation +| ^^^ entity.name.section.markdown +| ^ - entity - punctuation +| ^^ punctuation.definition.heading.end.markdown +| ^ - punctuation + +## https://spec.commonmark.org/0.30/#example-73 + +### foo ### +| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^^^^^ markup.heading.3.markdown +|^^ punctuation.definition.heading.begin.markdown +| ^ - entity - punctuation +| ^^^ entity.name.section.markdown +| ^ - entity - punctuation +| ^^^ punctuation.definition.heading.end.markdown +| ^^^^^^ - punctuation + +## https://spec.commonmark.org/0.30/#example-74 + +### foo ### b +| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^^ markup.heading.3.markdown +|^^ punctuation.definition.heading.begin.markdown +| ^ - entity - punctuation +| ^^^^^^^^^ entity.name.section.markdown +| ^ - entity + +## https://spec.commonmark.org/0.30/#example-75 + +# foo# +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^ markup.heading.1.markdown +|^ - entity - punctuation +| ^^^^ entity.name.section.markdown +| ^ - entity + +# foo# # +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^ markup.heading.1.markdown +|^ - entity - punctuation +| ^^^^ entity.name.section.markdown +| ^ - entity - punctuation +| ^ punctuation.definition.heading.end.markdown +| ^ - punctuation + +## https://spec.commonmark.org/0.30/#example-76 + +### foo \### +| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^ markup.heading.3.markdown +|^^ punctuation.definition.heading.begin.markdown +| ^^^^^^^^ entity.name.section.markdown +| ^^ constant.character.escape.markdown +| ^ - constant - entity - punctuation + +## foo #\## | <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^^^^^^ markup.heading.2.markdown -|^^ - entity -| ^^^^^^^^^^^ entity.name.section.markdown -| ^^ constant.character.escape.markdown -| ^^^ - punctuation -| ^ - entity.name.section +|^^^^^^^^^^^ markup.heading.2.markdown +|^ punctuation.definition.heading.begin.markdown +| ^^^^^^^^ entity.name.section.markdown +| ^^ constant.character.escape.markdown +| ^ - constant - entity - punctuation -https://spec.commonmark.org/0.30/#example-79 +# foo \# +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^ markup.heading.1.markdown +| ^^^^^^ entity.name.section.markdown +| ^^ constant.character.escape.markdown +| ^ - constant - entity - punctuation + +## https://spec.commonmark.org/0.30/#example-77 + +**** +## foo +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown +|^^^^^^ markup.heading.2.markdown + +**** +## foo +**** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown + +## https://spec.commonmark.org/0.30/#example-78 + +Foo bar +# baz +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.1.markdown + +Foo bar +# baz +Bar foo +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^ meta.paragraph.markdown - markup.heading + +Foo **bar +# baz +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.bold +|^^^^^ markup.heading.1.markdown +this must not be bold** +| <- - meta.bold +|^^^^^^^^^^^^^^^^^^^^^^ - meta.bold + +Foo *bar +# baz +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.italic +|^^^^ markup.heading.1.markdown +this must not be italic* +| <- - meta.italic +|^^^^^^^^^^^^^^^^^^^^^^^ - meta.italic + +Foo ***bar +# baz +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.bold - markup.italic +|^^^^^ markup.heading.1.markdown +this must not be bold italic*** +| <- - meta.bold - markup.italic +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - markup.italic + +## https://spec.commonmark.org/0.30/#example-79 # | <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown @@ -504,38 +678,8 @@ https://spec.commonmark.org/0.30/#example-79 | ^^^ - entity.name.section | ^^ punctuation.definition.heading.end.markdown -#NotAHeading -| <- - markup.heading -|^^^^^^^^^^^^ - markup.heading - -Headings terminate paragraphs -# Heading -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.bold -|^^^^^^^^ markup.heading.1.markdown - -Headings terminate **bold text -# Heading -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.bold -|^^^^^^^^ markup.heading.1.markdown -this must not be bold** -| <- - meta.bold -|^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - -Headings terminate *italic text -# Heading -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.italic -|^^^^^^^^ markup.heading.1.markdown -this must not be italic* -| <- - meta.italic -|^^^^^^^^^^^^^^^^^^^^^^^ - meta.italic -Headings terminate ***bold italic text -# Heading -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.bold - markup.italic -|^^^^^^^^ markup.heading.1.markdown -this must not be bold italic*** -| <- - meta.bold - markup.italic -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - markup.italic +# TEST: SETEXT HEADINGS ####################################################### Alternate Heading ================= @@ -3785,14 +3929,6 @@ link with a single underscore inside the text : [@_test](http://example.com) | ^^^^^^ meta.paragraph meta.link.inline.description - punctuation.definition | ^ meta.paragraph meta.link.inline punctuation.definition.link.end -# h1 -- list -## h2 -|^ punctuation.definition.heading.begin -1. list -### h3 -|^^ punctuation.definition.heading.begin - 1. list [001]blah | ^^^^^ meta.link.reference | ^ punctuation.definition.link.begin From f86118904aa22c7269fef52831cfb64629b1e55c Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Mon, 27 Dec 2021 14:38:31 +0100 Subject: [PATCH 12/63] Syntax: Move Thematic break tests This commit starts to organize test cases by CommonMark example id. --- tests/syntax_test_markdown.md | 2042 ++++++++++++++++----------------- 1 file changed, 1017 insertions(+), 1025 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 339b28b9..3e64335f 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -83,6 +83,18 @@ | ^ punctuation.definition.thematic-break.markdown | ^ punctuation.definition.thematic-break.markdown +- - - +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^ meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown + +_ _ _ +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^ meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown + # TEST: BACKSLASH ESCAPES ##################################################### @@ -397,1236 +409,1216 @@ foo bar | ^^^^^^ constant.character.entity.named.html -# TEST: ATX HEADINGS ########################################################## - -## https://spec.commonmark.org/0.30/#example-62 - -# foo -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^ markup.heading.1.markdown - punctuation +# TEST: THEMATIC BREAKS ####################################################### -## foo -| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown -|^ markup.heading.2.markdown punctuation.definition.heading.begin.markdown -| ^^^^^ markup.heading.2.markdown - punctuation +## https://spec.commonmark.org/0.30/#example-43 -### foo -| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown -|^^ markup.heading.3.markdown punctuation.definition.heading.begin.markdown -| ^^^^^ markup.heading.3.markdown - punctuation +*** +|^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown -#### foo -| <- markup.heading.4.markdown punctuation.definition.heading.begin.markdown -|^^^ markup.heading.4.markdown punctuation.definition.heading.begin.markdown -| ^^^^^ markup.heading.4.markdown - punctuation +--- +|^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown -##### foo -| <- markup.heading.5.markdown punctuation.definition.heading.begin.markdown -|^^^^ markup.heading.5.markdown punctuation.definition.heading.begin.markdown -| ^^^^^ markup.heading.5.markdown - punctuation +___ +|^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown -###### foo -| <- markup.heading.6.markdown punctuation.definition.heading.begin.markdown -|^^^^^ markup.heading.6.markdown punctuation.definition.heading.begin.markdown -| ^^^^^ markup.heading.6.markdown - punctuation +## https://spec.commonmark.org/0.30/#example-44 -## https://spec.commonmark.org/0.30/#example-63 ++++ +| <- - meta.separator +|^^^ - meta.separator -####### foo -| <- meta.paragraph.markdown - markup.heading -|^^^^^^^^^^^ meta.paragraph.markdown - markup.heading +## https://spec.commonmark.org/0.30/#example-45 -## https://spec.commonmark.org/0.30/#example-64 +=== +| <- - meta.separator +|^^^ - meta.separator -#5 bolt -| <- meta.paragraph.markdown - markup.heading -|^^^^^^^ meta.paragraph.markdown - markup.heading +## https://spec.commonmark.org/0.30/#example-46 -#hashtag -| <- meta.paragraph.markdown - markup.heading -|^^^^^^^^ meta.paragraph.markdown - markup.heading +** +| <- - meta.separator +|^ - meta.separator -## https://spec.commonmark.org/0.30/#example-65 +-- +| <- - meta.separator +|^ - meta.separator -\## foo -| <- meta.paragraph.markdown constant.character.escape.markdown - markup -|^ meta.paragraph.markdown constant.character.escape.markdown - markup -| ^^^^^^ meta.paragraph.markdown - constant - markup +__ +| <- - meta.separator +|^ - meta.separator -## https://spec.commonmark.org/0.30/#example-66 +## https://spec.commonmark.org/0.30/#example-47 -# foo *bar* \*baz\* -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^ markup.heading.1.markdown - entity.name - markup.italic -| ^^^^ markup.heading.1.markdown entity.name.section.markdown - markup.italic -| ^^^^^ markup.heading.1.markdown entity.name.section.markdown markup.italic.markdown -| ^^^^^^^^ markup.heading.1.markdown entity.name.section.markdown - markup.italic + *** +|<- meta.separator.thematic-break.markdown - punctuation +|^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -## https://spec.commonmark.org/0.30/#example-67 + *** +|<- meta.separator.thematic-break.markdown - punctuation +|^ meta.separator.thematic-break.markdown - punctuation +| ^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -# foo -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^^^^^^^^^^ markup.heading.1.markdown - entity.name -| ^^^ markup.heading.1.markdown entity.name.section.markdown -| ^^^^^^^^^^^^^^^^^^^^^^ markup.heading.1.markdown - entity.name + *** +|<- meta.separator.thematic-break.markdown - punctuation +|^^ meta.separator.thematic-break.markdown - punctuation +| ^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -## https://spec.commonmark.org/0.30/#example-68 +## https://spec.commonmark.org/0.30/#example-48 - ### foo -| <- markup.heading.3.markdown -|^^^^^^^^ markup.heading.3.markdown - ## foo -| <- markup.heading.2.markdown -|^^^^^^^^ markup.heading.2.markdown - # foo -| <- markup.heading.1.markdown -|^^^^^^^^ markup.heading.1.markdown + *** +|<- markup.raw.block.markdown +|^^^^^^^ markup.raw.block.markdown -## https://spec.commonmark.org/0.30/#example-69 +## https://spec.commonmark.org/0.30/#example-49 - # foo -| <- markup.raw.block.markdown -|^^^^^^^^^ markup.raw.block.markdown +Foo + *** +| <- meta.paragraph.markdown +|^^^^^^^ meta.paragraph.markdown -## https://spec.commonmark.org/0.30/#example-70 +## https://spec.commonmark.org/0.30/#example-50 -foo - # bar -| <- meta.paragraph.markdown - markup.heading -|^^^^^^^^^ meta.paragraph.markdown - markup.heading +************************************** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -## https://spec.commonmark.org/0.30/#example-71 +-------------------------------------- +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -## foo ## - ### bar ### -| <- markup.heading.3.markdown -|^^^^^^^^^^^^^^^^^^ markup.heading.3.markdown -| ^^^ punctuation.definition.heading.begin.markdown -| ^^^ - entity - punctuation -| ^^^ entity.name.section.markdown -| ^^^^ - entity - punctuation -| ^^^ punctuation.definition.heading.end.markdown -| ^ - punctuation +_____________________________________ +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -## https://spec.commonmark.org/0.30/#example-72 +## https://spec.commonmark.org/0.30/#example-51 -# foo ################################## -##### foo ## -| <- markup.heading.5.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^^^^ markup.heading.5.markdown -|^^^^ punctuation.definition.heading.begin.markdown -| ^ - entity - punctuation -| ^^^ entity.name.section.markdown -| ^ - entity - punctuation -| ^^ punctuation.definition.heading.end.markdown -| ^ - punctuation + * * * +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^ meta.separator.thematic-break.markdown +|^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation -## https://spec.commonmark.org/0.30/#example-73 + - - - +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^ meta.separator.thematic-break.markdown +|^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation -### foo ### -| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^^^^^^^^ markup.heading.3.markdown -|^^ punctuation.definition.heading.begin.markdown -| ^ - entity - punctuation -| ^^^ entity.name.section.markdown -| ^ - entity - punctuation -| ^^^ punctuation.definition.heading.end.markdown -| ^^^^^^ - punctuation + _ _ _ +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^ meta.separator.thematic-break.markdown +|^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation -## https://spec.commonmark.org/0.30/#example-74 +## https://spec.commonmark.org/0.30/#example-52 -### foo ### b -| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^^^^^ markup.heading.3.markdown -|^^ punctuation.definition.heading.begin.markdown -| ^ - entity - punctuation -| ^^^^^^^^^ entity.name.section.markdown -| ^ - entity + ** * ** * ** * ** +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown +| ^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation -## https://spec.commonmark.org/0.30/#example-75 + -- - -- - -- - -- +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown +| ^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation -# foo# -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^^ markup.heading.1.markdown -|^ - entity - punctuation -| ^^^^ entity.name.section.markdown -| ^ - entity + __ _ __ _ __ _ __ +| <- meta.separator.thematic-break.markdown - punctuation +|^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown +| ^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation +| ^^ punctuation.definition.thematic-break.markdown +| ^ - punctuation -# foo# # -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^ markup.heading.1.markdown -|^ - entity - punctuation -| ^^^^ entity.name.section.markdown -| ^ - entity - punctuation -| ^ punctuation.definition.heading.end.markdown -| ^ - punctuation +## https://spec.commonmark.org/0.30/#example-53 -## https://spec.commonmark.org/0.30/#example-76 +* * * * +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation -### foo \### -| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^^^^ markup.heading.3.markdown -|^^ punctuation.definition.heading.begin.markdown -| ^^^^^^^^ entity.name.section.markdown -| ^^ constant.character.escape.markdown -| ^ - constant - entity - punctuation +- - - - +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation -## foo #\## -| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^^^ markup.heading.2.markdown -|^ punctuation.definition.heading.begin.markdown -| ^^^^^^^^ entity.name.section.markdown -| ^^ constant.character.escape.markdown -| ^ - constant - entity - punctuation +_ _ _ _ +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown +|^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^^^^^^ - punctuation +| ^ punctuation.definition.thematic-break.markdown +| ^ - punctuation -# foo \# -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^ markup.heading.1.markdown -| ^^^^^^ entity.name.section.markdown -| ^^ constant.character.escape.markdown -| ^ - constant - entity - punctuation +## https://spec.commonmark.org/0.30/#example-54 -## https://spec.commonmark.org/0.30/#example-77 +* * * * +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^ meta.separator.thematic-break.markdown +|^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation -**** -## foo -| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown -|^^^^^^ markup.heading.2.markdown +- - - - +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^ meta.separator.thematic-break.markdown +|^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation -**** -## foo -**** +_ _ _ _ | <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^ meta.separator.thematic-break.markdown +|^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation -## https://spec.commonmark.org/0.30/#example-78 +## https://spec.commonmark.org/0.30/#example-55 -Foo bar -# baz -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^ markup.heading.1.markdown +_ _ _ _ a +| <- meta.paragraph.markdown - meta.separator +|^^^^^^^^^ meta.paragraph.markdown - meta.separator -Foo bar -# baz -Bar foo -| <- meta.paragraph.markdown - markup.heading -|^^^^^^^ meta.paragraph.markdown - markup.heading +a------ +| <- meta.paragraph.markdown - meta.separator +|^^^^^^^ meta.paragraph.markdown - meta.separator -Foo **bar -# baz -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.bold -|^^^^^ markup.heading.1.markdown -this must not be bold** -| <- - meta.bold -|^^^^^^^^^^^^^^^^^^^^^^ - meta.bold +---a--- +| <- meta.paragraph.markdown - meta.separator +|^^^^^^^ meta.paragraph.markdown - meta.separator -Foo *bar -# baz -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.italic -|^^^^ markup.heading.1.markdown -this must not be italic* -| <- - meta.italic -|^^^^^^^^^^^^^^^^^^^^^^^ - meta.italic +## https://spec.commonmark.org/0.30/#example-56 -Foo ***bar -# baz -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.bold - markup.italic -|^^^^^ markup.heading.1.markdown -this must not be bold italic*** -| <- - meta.bold - markup.italic -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - markup.italic + *-* +| <- meta.paragraph.markdown - meta.separator +|^^^ meta.paragraph.markdown - meta.separator -## https://spec.commonmark.org/0.30/#example-79 +## https://spec.commonmark.org/0.30/#example-57 -# -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +- foo +*** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +- bar +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -# # -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^ markup.heading.1.markdown - entity.name.section -| ^ punctuation.definition.heading.end.markdown +## https://spec.commonmark.org/0.30/#example-58 -## -| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown - entity.name.section -|^ markup.heading.2.markdown punctuation.definition.heading.begin.markdown - entity.name.section +Foo +*** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +bar +| <- meta.paragraph.markdown -## ## -| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown - entity.name.section -|^^^^^ markup.heading.2.markdown - entity.name.section -|^ punctuation.definition.heading.begin.markdown -| ^^ punctuation.definition.heading.end.markdown +## https://spec.commonmark.org/0.30/#example-59 -### ### -| <- markup.heading.3.markdown - entity.name.sectionpunctuation.definition.heading.begin.markdown -|^^^^^^^ markup.heading.3.markdown - entity.name.section -|^^ punctuation.definition.heading.begin.markdown -| ^^^ punctuation.definition.heading.end.markdown +Foo +--- +| <- markup.heading.2.setext.markdown punctuation.definition.heading.setext.markdown +|^^ markup.heading.2.setext.markdown punctuation.definition.heading.setext.markdown +bar +| <- meta.paragraph.markdown -# #### # -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^ markup.heading.1.markdown -|^ - entity.name.section -| ^^^^ entity.name.section.markdown -| ^^ - entity.name.section -| ^ punctuation.definition.heading.end.markdown +## https://spec.commonmark.org/0.30/#example-60 -## #### ## -| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^^ markup.heading.2.markdown -|^ - entity.name.section -| ^^^^ entity.name.section.markdown -| ^^^ - entity.name.section -| ^^ punctuation.definition.heading.end.markdown +* Foo +* * * +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^ meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +| ^ punctuation.definition.thematic-break.markdown +* Bar +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +## https://spec.commonmark.org/0.30/#example-61 -# TEST: SETEXT HEADINGS ####################################################### +- Foo +- * * * +| ^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.separator.thematic-break.markdown -Alternate Heading -================= -|^^^^^^^^^^^^^^^^ markup.heading.1 punctuation.definition -| ^ meta.whitespace.newline -heading underlined with dashes ------------------------------- -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.2 punctuation.definition.heading +# TEST: ATX HEADINGS ########################################################## -underlined heading followed by a separator -------------------- ------- -| <- meta.separator - markup.heading +## https://spec.commonmark.org/0.30/#example-62 -underlined heading followed by another one that should be treated as a normal paragraph -================== -===== -| <- - markup.heading +# foo +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.1.markdown - punctuation -``` -Fenced codeblocks are no no setext heading -``` ---- -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - - -Paragraph of text that should be scoped as meta.paragraph. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph -A [link](https://example.com){ :_attr = value }, *italic text* and **bold**. -| ^^^^^^ meta.link.inline.description.markdown -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^^^^^^^^^^ meta.attribute-with-value.markdown -| ^^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^ string.unquoted.markdown -| ^ punctuation.definition.attributes.end.markdown -| ^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^ punctuation.definition.bold -| ^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold - -Inline `code sample`. -| ^^^^^^^^^^^^^ markup.raw.inline -| ^ punctuation.definition.raw -| ^ punctuation.definition.raw - -Here is a [](https://example.com). -| ^^ meta.link.inline -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata - -Here is a [](https://example.com){_attr="value"}. -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^^^ string.quoted.double.markdown -| ^ punctuation.definition.attributes.end.markdown - -Here is a [link](#with_(parens/inside)_urls). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [link](\(foo\)). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^ markup.underline.link.markdown -| ^^ constant.character.escape.markdown -| ^^ constant.character.escape.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [link](foo\)\:). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^ markup.underline.link.markdown -| ^^ constant.character.escape.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [link](). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^^^^ markup.underline.link.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [link](http://example.com?foo=3#frag). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.definition.metadata.end.markdown - -Not a [link] (url) due to space. -| ^^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link - -Here is a [reference link][name]. -| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^ meta.link.reference.metadata.markdown -| ^ punctuation.definition.link.begin.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [reference link][name]{_attr='value' :att2}. -| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^ meta.link.reference.metadata.markdown -| ^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.attributes.markdown -| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown -| ^ - meta.attribute-with-value -| ^^^^^ meta.attribute-with-value.markdown -| ^ punctuation.definition.link.begin.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^^^ string.quoted.single.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.definition.attributes.end.markdown - -Here is a [blank reference link][]{}. -| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.literal.description.markdown -| ^^ meta.link.reference.literal.metadata.markdown -| ^^ meta.link.reference.literal.attributes.markdown -| ^ punctuation.definition.link.begin.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^ punctuation.definition.metadata.end.markdown -| ^ punctuation.definition.attributes.begin.markdown -| ^ punctuation.definition.attributes.end.markdown - -Here is a footnote[^1][link][] or long[^longnote][link][]. -| ^^^^ meta.link.reference.footnote.markdown-extra -| ^^^^^^ meta.link.reference.literal.description.markdown -| ^^ meta.link.reference.literal.metadata.markdown -| ^^^^^^^^^^^ meta.link.reference.footnote.markdown-extra -| ^^^^^^^^ meta.link.reference.literal - -Here is a footnote [^footnote](not_link_dest). -| ^^^^^^^^^^^ meta.paragraph.markdown meta.link.reference.footnote.markdown-extra -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^ meta.link.reference.literal.footnote-id.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.link - -Here is a ![](https://example.com/cat.gif). -| ^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown +## foo +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown +|^ markup.heading.2.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.2.markdown - punctuation -Here is a ![](https://example.com/cat.gif){_at"r=value :att2}. -| ^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^^^^^^^^^^^^^^^^^^ meta.image.inline.attributes.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ invalid.illegal.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^ string.unquoted.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.definition.attributes.end.markdown +### foo +| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown +|^^ markup.heading.3.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.3.markdown - punctuation -Here is a ![Image Alt Text](https://example.com/cat.gif). -| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown +#### foo +| <- markup.heading.4.markdown punctuation.definition.heading.begin.markdown +|^^^ markup.heading.4.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.4.markdown - punctuation -Here is a ![Image Alt Text]( https://example.com/cat.gif ). -| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^ - markup.underline -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^^ - markup.underline -| ^ punctuation.definition.metadata.end.markdown +##### foo +| <- markup.heading.5.markdown punctuation.definition.heading.begin.markdown +|^^^^ markup.heading.5.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.5.markdown - punctuation -Here is a ![Image Alt Text]( - https://example.com/cat.gif ). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown +###### foo +| <- markup.heading.6.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.6.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.6.markdown - punctuation -Here is a ![Image Alt Text]( - https://example.com/cat.gif - "hello" ). -|^^^^^^^ meta.image.inline string.quoted.double -| ^^^^ meta.image.inline -| ^ punctuation.definition.metadata.end +## https://spec.commonmark.org/0.30/#example-63 -Here is a ![Image Alt Text]( - "hello" ). -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown -| ^^ meta.paragraph.markdown - meta.image -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^^^ string.quoted.double.markdown -| ^ punctuation.definition.string.begin.markdown -| ^ punctuation.definition.string.end.markdown -| ^ punctuation.definition.metadata.end.markdown +####### foo +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^^^^^ meta.paragraph.markdown - markup.heading -Here is a ![Image Alt Text]( - (hello) ). -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown -| ^^ meta.paragraph.markdown - meta.image -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^^^ string.quoted.other.markdown -| ^ punctuation.definition.string.begin.markdown -| ^ punctuation.definition.string.end.markdown -| ^ punctuation.definition.metadata.end.markdown +## https://spec.commonmark.org/0.30/#example-64 -Here is a ![Image Alt Text]( - https://example .com /cat.gif (hello) ). -|^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline -| ^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown markup.underline.link.image.markdown -| ^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.image - markup.underline +#5 bolt +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^ meta.paragraph.markdown - markup.heading -Here is a ![Image Ref Alt][1]. -| ^^^^^^^^^^^^^^^^ meta.image.reference.description.markdown -| ^^^ meta.image.reference.metadata.markdown -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown +#hashtag +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^^ meta.paragraph.markdown - markup.heading -now you can access the [The Ever Cool Site: Documentation about Sites]( - www.thecoolsite.com.ca/documentations/about/cool ) for more information about... -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline markup.underline.link -| ^ - invalid -| ^ meta.link.inline punctuation.definition.metadata.end +## https://spec.commonmark.org/0.30/#example-65 -now you can access the [The Ever Cool Site: Documentation about Sites]( - www.thecoolsite.com.ca /documentations/about/cool ) for more information about... -| ^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inline markup.underline.link -| ^ meta.paragraph meta.link.inline - markup.underline.link -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - meta.link.inline +\## foo +| <- meta.paragraph.markdown constant.character.escape.markdown - markup +|^ meta.paragraph.markdown constant.character.escape.markdown - markup +| ^^^^^^ meta.paragraph.markdown - constant - markup -now you can access the [The Ever Cool Site: Documentation about Sites]( - www.thecoolsite.com.ca/documentations/about/cool - (title)) for more information about... -| ^^^^^^^^ meta.paragraph meta.link.inline -| ^ punctuation.definition.metadata.end -| ^^^^^^^ string.quoted.other.markdown +## https://spec.commonmark.org/0.30/#example-66 - 1. Ordered list item -| ^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered -| ^^ markup.list.numbered.bullet - markup.list.numbered markup.list.numbered -| ^ punctuation.definition.list_item - 2. Ordered list item #2 -| ^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered - markup.list.numbered markup.list.numbered -| ^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item - 1. Subitem - 2. Another subitem -|^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered -| ^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item -| ^^^^^^^^^^^^^^^^ meta.paragraph.list - meta.paragraph.list meta.paragraph.list +# foo *bar* \*baz\* +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^ markup.heading.1.markdown - entity.name - markup.italic +| ^^^^ markup.heading.1.markdown entity.name.section.markdown - markup.italic +| ^^^^^ markup.heading.1.markdown entity.name.section.markdown markup.italic.markdown +| ^^^^^^^^ markup.heading.1.markdown entity.name.section.markdown - markup.italic -Paragraph break. +## https://spec.commonmark.org/0.30/#example-67 - - Unordered list item -| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - - Unordered list item #2 -| ^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item +# foo +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^^^^^^^ markup.heading.1.markdown - entity.name +| ^^^ markup.heading.1.markdown entity.name.section.markdown +| ^^^^^^^^^^^^^^^^^^^^^^ markup.heading.1.markdown - entity.name -Paragraph break. +## https://spec.commonmark.org/0.30/#example-68 -- `` | `` (components/Logo.vue) -- `` | `` | (components/my-component.vue) -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown + ### foo +| <- markup.heading.3.markdown +|^^^^^^^^ markup.heading.3.markdown + ## foo +| <- markup.heading.2.markdown +|^^^^^^^^ markup.heading.2.markdown + # foo +| <- markup.heading.1.markdown +|^^^^^^^^ markup.heading.1.markdown -Paragraph break. +## https://spec.commonmark.org/0.30/#example-69 - * Unordered list item -| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - + Unordered list item #2 -| ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - + Subitem 1 -| ^ punctuation.definition.list_item - + Item - + Subitem - + Another subitem -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - meta.paragraph.list -| ^^^^^^^^^^^^^^^ meta.paragraph.list - + Nested Subitem -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - markup.list.unnumbered markup.list.unnumbered - + Nested + Subitem -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -| ^ - punctuation.definition.list_item + # foo +| <- markup.raw.block.markdown +|^^^^^^^^^ markup.raw.block.markdown - * Unsorted list item - ```xml -|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -| ^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm constant.other.language-name.markdown - -|^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown markup.raw.code-fence.xml.markdown-gfm text.xml meta.tag.xml - ``` -|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +## https://spec.commonmark.org/0.30/#example-70 -Paragraph break. +foo + # bar +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^^^ meta.paragraph.markdown - markup.heading -> This is a block quote. It contains markup. -> Including things like *italics* -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote -| ^^^^^^^^^ markup.italic +## https://spec.commonmark.org/0.30/#example-71 -[1]: https://google.com -| <- meta.link.reference.def.markdown -|^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -|^ entity.name.reference.link -| ^ punctuation.separator.key-value -| ^^^^^^^^^^^^^^^^^^ markup.underline.link +## foo ## + ### bar ### +| <- markup.heading.3.markdown +|^^^^^^^^^^^^^^^^^^ markup.heading.3.markdown +| ^^^ punctuation.definition.heading.begin.markdown +| ^^^ - entity - punctuation +| ^^^ entity.name.section.markdown +| ^^^^ - entity - punctuation +| ^^^ punctuation.definition.heading.end.markdown +| ^ - punctuation -
this is HTML until there are two blank lines
-| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -disabled markdown -| <- meta.disable-markdown +## https://spec.commonmark.org/0.30/#example-72 -non-disabled markdown -| <- - meta.disable-markdown +# foo ################################## +##### foo ## +| <- markup.heading.5.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^ markup.heading.5.markdown +|^^^^ punctuation.definition.heading.begin.markdown +| ^ - entity - punctuation +| ^^^ entity.name.section.markdown +| ^ - entity - punctuation +| ^^ punctuation.definition.heading.end.markdown +| ^ - punctuation -
this is HTML until there are two blank lines -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -still HTML -| ^^^^ meta.tag.inline.any.html entity.name.tag.inline.any.html -
-| ^^^^ meta.disable-markdown +## https://spec.commonmark.org/0.30/#example-73 -non-disabled markdown -| <- - meta.disable-markdown +### foo ### +| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^^^^^ markup.heading.3.markdown +|^^ punctuation.definition.heading.begin.markdown +| ^ - entity - punctuation +| ^^^ entity.name.section.markdown +| ^ - entity - punctuation +| ^^^ punctuation.definition.heading.end.markdown +| ^^^^^^ - punctuation -
nested tags don't count 
test
-| ^^^^^^ meta.disable-markdown meta.tag.block.any.html -non-disabled markdown -| <- - meta.disable-markdown +## https://spec.commonmark.org/0.30/#example-74 -
nested tags don't count
test -| ^^^^^ meta.disable-markdown -
-| ^^^ meta.disable-markdown entity.name.tag.block.any.html +### foo ### b +| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^^ markup.heading.3.markdown +|^^ punctuation.definition.heading.begin.markdown +| ^ - entity - punctuation +| ^^^^^^^^^ entity.name.section.markdown +| ^ - entity -non-disabled markdown -| <- - meta.disable-markdown +## https://spec.commonmark.org/0.30/#example-75 -
two blank lines needed
to stop disabled markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -disabled markdown -| <- meta.disable-markdown +# foo# +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^ markup.heading.1.markdown +|^ - entity - punctuation +| ^^^^ entity.name.section.markdown +| ^ - entity -non-disabled markdown -| <- - meta.disable-markdown +# foo# # +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^ markup.heading.1.markdown +|^ - entity - punctuation +| ^^^^ entity.name.section.markdown +| ^ - entity - punctuation +| ^ punctuation.definition.heading.end.markdown +| ^ - punctuation -
another
disable test -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -| ^^^^^^ meta.tag.inline.any.html -disabled markdown -| <- meta.disable-markdown +## https://spec.commonmark.org/0.30/#example-76 -non-disabled markdown -| <- - meta.disable-markdown +### foo \### +| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^^ markup.heading.3.markdown +|^^ punctuation.definition.heading.begin.markdown +| ^^^^^^^^ entity.name.section.markdown +| ^^ constant.character.escape.markdown +| ^ - constant - entity - punctuation -*a* -| ^ markup.italic -

*a*

-| ^^^^^^^^^ meta.disable-markdown - markup.italic -*a* -| ^^ meta.disable-markdown +## foo #\## +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^^ markup.heading.2.markdown +|^ punctuation.definition.heading.begin.markdown +| ^^^^^^^^ entity.name.section.markdown +| ^^ constant.character.escape.markdown +| ^ - constant - entity - punctuation -non-disabled markdown -| <- - meta.disable-markdown +# foo \# +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^ markup.heading.1.markdown +| ^^^^^^ entity.name.section.markdown +| ^^ constant.character.escape.markdown +| ^ - constant - entity - punctuation +## https://spec.commonmark.org/0.30/#example-77 -# TEST: BLOCK QUOTES ########################################################## +**** +## foo +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown +|^^^^^^ markup.heading.2.markdown ->= -| <- punctuation.definition.blockquote.markdown +**** +## foo +**** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown ->== -| <- punctuation.definition.blockquote.markdown +## https://spec.commonmark.org/0.30/#example-78 - >= -| ^ punctuation.definition.blockquote.markdown - >= -| ^^ - punctuation.definition.blockquote.markdown +Foo bar +# baz +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.1.markdown - >= -| ^^ - punctuation.definition.blockquote.markdown +Foo bar +# baz +Bar foo +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^ meta.paragraph.markdown - markup.heading -> Block quote -| <- markup.quote punctuation.definition.blockquote -| ^^^^^^^^^^^ markup.quote +Foo **bar +# baz +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.bold +|^^^^^ markup.heading.1.markdown +this must not be bold** +| <- - meta.bold +|^^^^^^^^^^^^^^^^^^^^^^ - meta.bold -> Block quote followed by an empty block quote line -> -| <- markup.quote punctuation.definition.blockquote +Foo *bar +# baz +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.italic +|^^^^ markup.heading.1.markdown +this must not be italic* +| <- - meta.italic +|^^^^^^^^^^^^^^^^^^^^^^^ - meta.italic -> Block quote followed by an empty block quote line -> -> Followed by more quoted text -| <- markup.quote punctuation.definition.blockquote +Foo ***bar +# baz +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.bold - markup.italic +|^^^^^ markup.heading.1.markdown +this must not be bold italic*** +| <- - meta.bold - markup.italic +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - markup.italic -> > Nested block quote -| <- markup.quote punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown -|^ - punctuation -| ^ punctuation.definition.blockquote -| ^ - punctuation +## https://spec.commonmark.org/0.30/#example-79 -> > Nested quote -> Followed by more quoted text that is not nested -| <- markup.quote punctuation.definition.blockquote - markup.quote markup.quote +# +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -> Here is a block quote -This quote continues on. Line breaking is OK in markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote -> Here it is again -| <- punctuation.definition.blockquote +# # +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^ markup.heading.1.markdown - entity.name.section +| ^ punctuation.definition.heading.end.markdown -paragraph -| <- meta.paragraph +## +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown - entity.name.section +|^ markup.heading.2.markdown punctuation.definition.heading.begin.markdown - entity.name.section -> > this is a nested quote but no code in a block quote -| <- punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown +## ## +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown - entity.name.section +|^^^^^ markup.heading.2.markdown - entity.name.section +|^ punctuation.definition.heading.begin.markdown +| ^^ punctuation.definition.heading.end.markdown -> > this is code in a block quote, not a nested quote -| <- punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block - markup.quote markup.quote +### ### +| <- markup.heading.3.markdown - entity.name.sectionpunctuation.definition.heading.begin.markdown +|^^^^^^^ markup.heading.3.markdown - entity.name.section +|^^ punctuation.definition.heading.begin.markdown +| ^^^ punctuation.definition.heading.end.markdown -> CommonMark expects following line to be indented code block (see: example 326) - > but all common parsers handle it as continued text. -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown - markup.raw -| ^ - punctuation +# #### # +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^ markup.heading.1.markdown +|^ - entity.name.section +| ^^^^ entity.name.section.markdown +| ^^ - entity.name.section +| ^ punctuation.definition.heading.end.markdown -> Quoted fenced code block begin -> ``` -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm -| ^^^ punctuation.definition.raw.code-fence.begin.markdown +## #### ## +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^^ markup.heading.2.markdown +|^ - entity.name.section +| ^^^^ entity.name.section.markdown +| ^^^ - entity.name.section +| ^^ punctuation.definition.heading.end.markdown -> Quoted fenced code block language identifier -> ```C++ -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm -| ^^^ constant.other.language-name.markdown -> Quoted fenced code block language identifier -> ```C++ info string -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^^^^^^^^^^^^^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm -| ^^^ constant.other.language-name.markdown -| ^^^^^^^^^^^^^ - constant +# TEST: SETEXT HEADINGS ####################################################### -> Quoted fenced code block content -> ``` -> code block -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^^^^^^^^ markup.quote.markdown markup.raw.code-fence.markdown-gfm +Alternate Heading +================= +|^^^^^^^^^^^^^^^^ markup.heading.1 punctuation.definition +| ^ meta.whitespace.newline -> Quoted fenced code block end -> ``` -> ``` -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^ markup.quote.markdown meta.code-fence.definition.end.text.markdown-gfm -| ^^^ punctuation.definition.raw.code-fence.end.markdown +heading underlined with dashes +------------------------------ +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.2 punctuation.definition.heading -> > 2nd level quoted fenced code block -> > ``` -> > code block ``` -> > ``` -| <- markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown -|^^^ markup.quote.markdown markup.quote.markdown - meta.code-fence -| ^^^^ markup.quote.markdown markup.quote.markdown meta.code-fence.definition.end.text.markdown-gfm +underlined heading followed by a separator +------------------- +------ +| <- meta.separator - markup.heading + +underlined heading followed by another one that should be treated as a normal paragraph +================== +===== +| <- - markup.heading -> Block quote followed by fenced code block ``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown - meta.quote +Fenced codeblocks are no no setext heading ``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown - meta.quote +--- +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -> Quoted fenced code block is terminated by missing > at bol -> ``` -no code block -| <- meta.paragraph.markdown - meta.quote - meta.code-fence -|^^^^^^^^^^^^^ meta.paragraph.markdown - meta.quote - meta.code-fence -> Quoted fenced code block is terminated by missing > at bol -> ``` -> content -no code block -| <- meta.paragraph.markdown - meta.quote - meta.code-fence -|^^^^^^^^^^^^^ meta.paragraph.markdown - meta.quote - meta.code-fence +Paragraph of text that should be scoped as meta.paragraph. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph +A [link](https://example.com){ :_attr = value }, *italic text* and **bold**. +| ^^^^^^ meta.link.inline.description.markdown +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^^^^^^^^^^ meta.attribute-with-value.markdown +| ^^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^ string.unquoted.markdown +| ^ punctuation.definition.attributes.end.markdown +| ^^^^^^^^^^^^^ markup.italic +| ^ punctuation.definition.italic +| ^ punctuation.definition.italic +| ^^ punctuation.definition.bold +| ^^^^^^^^ markup.bold +| ^^ punctuation.definition.bold -> Unterminated quoted fenced code block followed by unquoted fenced code block -> ``` -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm - markup.quote -``` -| <- meta.code-fence.definition.end.text.markdown-gfm - markup.quote +Inline `code sample`. +| ^^^^^^^^^^^^^ markup.raw.inline +| ^ punctuation.definition.raw +| ^ punctuation.definition.raw + +Here is a [](https://example.com). +| ^^ meta.link.inline +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata + +Here is a [](https://example.com){_attr="value"}. +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^^^ string.quoted.double.markdown +| ^ punctuation.definition.attributes.end.markdown -> Block quote followed by heading -# heading -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^ markup.heading.1.markdown - meta.quote -| ^^^^^^^ entity.name.section.markdown +Here is a [link](#with_(parens/inside)_urls). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown -> Block quote followed by list -* list item -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote +Here is a [link](\(foo\)). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^ markup.underline.link.markdown +| ^^ constant.character.escape.markdown +| ^^ constant.character.escape.markdown +| ^ punctuation.definition.metadata.end.markdown -> Block quote followed by list -+ list item -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote +Here is a [link](foo\)\:). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^ markup.underline.link.markdown +| ^^ constant.character.escape.markdown +| ^ punctuation.definition.metadata.end.markdown -> Block quote followed by list -- list item -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote +Here is a [link](). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^^^^ markup.underline.link.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.end.markdown -> Block quote followed by list -1. list item -| <- markup.list.numbered.bullet.markdown - punctuation -|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^ markup.list.numbered.markdown - meta.quote +Here is a [link](http://example.com?foo=3#frag). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.definition.metadata.end.markdown -> Block quote followed by thematic break -*** -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote +Not a [link] (url) due to space. +| ^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^ - meta.link -> Block quote followed by thematic break -- - - -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote +Here is a [reference link][name]. +| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^ meta.link.reference.metadata.markdown +| ^ punctuation.definition.link.begin.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown +Here is a [reference link][name]{_attr='value' :att2}. +| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^ meta.link.reference.metadata.markdown +| ^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.attributes.markdown +| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown +| ^ - meta.attribute-with-value +| ^^^^^ meta.attribute-with-value.markdown +| ^ punctuation.definition.link.begin.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^^^ string.quoted.single.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.definition.attributes.end.markdown -# TEST: INDENTED CODE BLOCKS ################################################## +Here is a [blank reference link][]{}. +| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.literal.description.markdown +| ^^ meta.link.reference.literal.metadata.markdown +| ^^ meta.link.reference.literal.attributes.markdown +| ^ punctuation.definition.link.begin.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.attributes.begin.markdown +| ^ punctuation.definition.attributes.end.markdown -Code block below: +Here is a footnote[^1][link][] or long[^longnote][link][]. +| ^^^^ meta.link.reference.footnote.markdown-extra +| ^^^^^^ meta.link.reference.literal.description.markdown +| ^^ meta.link.reference.literal.metadata.markdown +| ^^^^^^^^^^^ meta.link.reference.footnote.markdown-extra +| ^^^^^^^^ meta.link.reference.literal - this is code! -| ^^^^^^^^^^^^^^^^ markup.raw.block +Here is a footnote [^footnote](not_link_dest). +| ^^^^^^^^^^^ meta.paragraph.markdown meta.link.reference.footnote.markdown-extra +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^ meta.link.reference.literal.footnote-id.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.link - more code - spanning multiple lines -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block +Here is a ![](https://example.com/cat.gif). +| ^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown -paragraph -| <- meta.paragraph +Here is a ![](https://example.com/cat.gif){_at"r=value :att2}. +| ^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^^^^^^^^^^^^^^^^^^ meta.image.inline.attributes.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ invalid.illegal.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^ string.unquoted.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.definition.attributes.end.markdown +Here is a ![Image Alt Text](https://example.com/cat.gif). +| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown -# TEST: THEMATIC BREAKS ####################################################### +Here is a ![Image Alt Text]( https://example.com/cat.gif ). +| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^ - markup.underline +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^^ - markup.underline +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-11 +Here is a ![Image Alt Text]( + https://example.com/cat.gif ). +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown -* * * -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^ meta.separator.thematic-break.markdown -| ^ punctuation.definition.thematic-break.markdown -| ^ punctuation.definition.thematic-break.markdown +Here is a ![Image Alt Text]( + https://example.com/cat.gif + "hello" ). +|^^^^^^^ meta.image.inline string.quoted.double +| ^^^^ meta.image.inline +| ^ punctuation.definition.metadata.end -- - - -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^ meta.separator.thematic-break.markdown -| ^ punctuation.definition.thematic-break.markdown -| ^ punctuation.definition.thematic-break.markdown +Here is a ![Image Alt Text]( + "hello" ). +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown +| ^^ meta.paragraph.markdown - meta.image +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^^^ string.quoted.double.markdown +| ^ punctuation.definition.string.begin.markdown +| ^ punctuation.definition.string.end.markdown +| ^ punctuation.definition.metadata.end.markdown -_ _ _ -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^ meta.separator.thematic-break.markdown -| ^ punctuation.definition.thematic-break.markdown -| ^ punctuation.definition.thematic-break.markdown +Here is a ![Image Alt Text]( + (hello) ). +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown +| ^^ meta.paragraph.markdown - meta.image +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^^^ string.quoted.other.markdown +| ^ punctuation.definition.string.begin.markdown +| ^ punctuation.definition.string.end.markdown +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-43 +Here is a ![Image Alt Text]( + https://example .com /cat.gif (hello) ). +|^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline +| ^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown markup.underline.link.image.markdown +| ^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.image - markup.underline -*** -|^^^ meta.separator.thematic-break.markdown -|^^ punctuation.definition.thematic-break.markdown +Here is a ![Image Ref Alt][1]. +| ^^^^^^^^^^^^^^^^ meta.image.reference.description.markdown +| ^^^ meta.image.reference.metadata.markdown +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown ---- -|^^^ meta.separator.thematic-break.markdown -|^^ punctuation.definition.thematic-break.markdown +now you can access the [The Ever Cool Site: Documentation about Sites]( + www.thecoolsite.com.ca/documentations/about/cool ) for more information about... +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline markup.underline.link +| ^ - invalid +| ^ meta.link.inline punctuation.definition.metadata.end -___ -|^^^ meta.separator.thematic-break.markdown -|^^ punctuation.definition.thematic-break.markdown +now you can access the [The Ever Cool Site: Documentation about Sites]( + www.thecoolsite.com.ca /documentations/about/cool ) for more information about... +| ^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inline markup.underline.link +| ^ meta.paragraph meta.link.inline - markup.underline.link +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - meta.link.inline -## https://spec.commonmark.org/0.30/#example-44 +now you can access the [The Ever Cool Site: Documentation about Sites]( + www.thecoolsite.com.ca/documentations/about/cool + (title)) for more information about... +| ^^^^^^^^ meta.paragraph meta.link.inline +| ^ punctuation.definition.metadata.end +| ^^^^^^^ string.quoted.other.markdown -+++ -| <- - meta.separator -|^^^ - meta.separator + 1. Ordered list item +| ^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered +| ^^ markup.list.numbered.bullet - markup.list.numbered markup.list.numbered +| ^ punctuation.definition.list_item + 2. Ordered list item #2 +| ^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered - markup.list.numbered markup.list.numbered +| ^^ markup.list.numbered.bullet +| ^ punctuation.definition.list_item + 1. Subitem + 2. Another subitem +|^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered +| ^^ markup.list.numbered.bullet +| ^ punctuation.definition.list_item +| ^^^^^^^^^^^^^^^^ meta.paragraph.list - meta.paragraph.list meta.paragraph.list -## https://spec.commonmark.org/0.30/#example-45 +Paragraph break. -=== -| <- - meta.separator -|^^^ - meta.separator + - Unordered list item +| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item + - Unordered list item #2 +| ^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -## https://spec.commonmark.org/0.30/#example-46 +Paragraph break. -** -| <- - meta.separator -|^ - meta.separator +- `` | `` (components/Logo.vue) +- `` | `` | (components/my-component.vue) +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown --- -| <- - meta.separator -|^ - meta.separator +Paragraph break. -__ -| <- - meta.separator -|^ - meta.separator + * Unordered list item +| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item + + Unordered list item #2 +| ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item + + Subitem 1 +| ^ punctuation.definition.list_item + + Item + + Subitem + + Another subitem +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - meta.paragraph.list +| ^^^^^^^^^^^^^^^ meta.paragraph.list + + Nested Subitem +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - markup.list.unnumbered markup.list.unnumbered + + Nested + Subitem +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item +| ^ - punctuation.definition.list_item -## https://spec.commonmark.org/0.30/#example-47 + * Unsorted list item + ```xml +|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm constant.other.language-name.markdown + +|^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown markup.raw.code-fence.xml.markdown-gfm text.xml meta.tag.xml + ``` +|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown - *** -|<- meta.separator.thematic-break.markdown - punctuation -|^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +Paragraph break. - *** -|<- meta.separator.thematic-break.markdown - punctuation -|^ meta.separator.thematic-break.markdown - punctuation -| ^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +> This is a block quote. It contains markup. +> Including things like *italics* +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote +| ^^^^^^^^^ markup.italic - *** -|<- meta.separator.thematic-break.markdown - punctuation -|^^ meta.separator.thematic-break.markdown - punctuation -| ^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +[1]: https://google.com +| <- meta.link.reference.def.markdown +|^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +|^ entity.name.reference.link +| ^ punctuation.separator.key-value +| ^^^^^^^^^^^^^^^^^^ markup.underline.link -## https://spec.commonmark.org/0.30/#example-48 +
this is HTML until there are two blank lines
+| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown +disabled markdown +| <- meta.disable-markdown - *** -|<- markup.raw.block.markdown -|^^^^^^^ markup.raw.block.markdown +non-disabled markdown +| <- - meta.disable-markdown -## https://spec.commonmark.org/0.30/#example-49 +
this is HTML until there are two blank lines +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown +still HTML +| ^^^^ meta.tag.inline.any.html entity.name.tag.inline.any.html +
+| ^^^^ meta.disable-markdown -Foo - *** -| <- meta.paragraph.markdown -|^^^^^^^ meta.paragraph.markdown +non-disabled markdown +| <- - meta.disable-markdown -## https://spec.commonmark.org/0.30/#example-50 +
nested tags don't count 
test
+| ^^^^^^ meta.disable-markdown meta.tag.block.any.html +non-disabled markdown +| <- - meta.disable-markdown -************************************** -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +
nested tags don't count
test +| ^^^^^ meta.disable-markdown +
+| ^^^ meta.disable-markdown entity.name.tag.block.any.html --------------------------------------- -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +non-disabled markdown +| <- - meta.disable-markdown -_____________________________________ -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +
two blank lines needed
to stop disabled markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown +disabled markdown +| <- meta.disable-markdown -## https://spec.commonmark.org/0.30/#example-51 +non-disabled markdown +| <- - meta.disable-markdown - * * * -| <- meta.separator.thematic-break.markdown - punctuation -|^^^^^^ meta.separator.thematic-break.markdown -|^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation +
another
disable test +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown +| ^^^^^^ meta.tag.inline.any.html +disabled markdown +| <- meta.disable-markdown - - - - -| <- meta.separator.thematic-break.markdown - punctuation -|^^^^^^ meta.separator.thematic-break.markdown -|^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation +non-disabled markdown +| <- - meta.disable-markdown - _ _ _ -| <- meta.separator.thematic-break.markdown - punctuation -|^^^^^^ meta.separator.thematic-break.markdown -|^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation +*a* +| ^ markup.italic +

*a*

+| ^^^^^^^^^ meta.disable-markdown - markup.italic +*a* +| ^^ meta.disable-markdown -## https://spec.commonmark.org/0.30/#example-52 +non-disabled markdown +| <- - meta.disable-markdown - ** * ** * ** * ** -| <- meta.separator.thematic-break.markdown - punctuation -|^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown -|^^ punctuation.definition.thematic-break.markdown -| ^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^^ punctuation.definition.thematic-break.markdown -| ^ - punctuation - -- - -- - -- - -- -| <- meta.separator.thematic-break.markdown - punctuation -|^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown -|^^ punctuation.definition.thematic-break.markdown -| ^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^^ punctuation.definition.thematic-break.markdown -| ^ - punctuation +# TEST: BLOCK QUOTES ########################################################## - __ _ __ _ __ _ __ -| <- meta.separator.thematic-break.markdown - punctuation -|^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown -|^^ punctuation.definition.thematic-break.markdown -| ^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation -| ^^ punctuation.definition.thematic-break.markdown -| ^ - punctuation +>= +| <- punctuation.definition.blockquote.markdown -## https://spec.commonmark.org/0.30/#example-53 +>== +| <- punctuation.definition.blockquote.markdown -* * * * -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown -|^^^^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^^^^^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^^^^^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation + >= +| ^ punctuation.definition.blockquote.markdown + >= +| ^^ - punctuation.definition.blockquote.markdown -- - - - -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown -|^^^^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^^^^^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^^^^^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation + >= +| ^^ - punctuation.definition.blockquote.markdown -_ _ _ _ -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown -|^^^^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^^^^^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^^^^^^ - punctuation -| ^ punctuation.definition.thematic-break.markdown -| ^ - punctuation +> Block quote +| <- markup.quote punctuation.definition.blockquote +| ^^^^^^^^^^^ markup.quote -## https://spec.commonmark.org/0.30/#example-54 +> Block quote followed by an empty block quote line +> +| <- markup.quote punctuation.definition.blockquote -* * * * -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^^ meta.separator.thematic-break.markdown -|^ - punctuation -| ^ punctuation.definition.thematic-break -| ^ - punctuation -| ^ punctuation.definition.thematic-break -| ^ - punctuation -| ^ punctuation.definition.thematic-break -| ^ - punctuation +> Block quote followed by an empty block quote line +> +> Followed by more quoted text +| <- markup.quote punctuation.definition.blockquote -- - - - -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^^ meta.separator.thematic-break.markdown +> > Nested block quote +| <- markup.quote punctuation.definition.blockquote +| ^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown |^ - punctuation -| ^ punctuation.definition.thematic-break +| ^ punctuation.definition.blockquote | ^ - punctuation -| ^ punctuation.definition.thematic-break -| ^ - punctuation -| ^ punctuation.definition.thematic-break -| ^ - punctuation -_ _ _ _ -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^^^ meta.separator.thematic-break.markdown -|^ - punctuation -| ^ punctuation.definition.thematic-break -| ^ - punctuation -| ^ punctuation.definition.thematic-break -| ^ - punctuation -| ^ punctuation.definition.thematic-break -| ^ - punctuation +> > Nested quote +> Followed by more quoted text that is not nested +| <- markup.quote punctuation.definition.blockquote - markup.quote markup.quote -## https://spec.commonmark.org/0.30/#example-55 +> Here is a block quote +This quote continues on. Line breaking is OK in markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote +> Here it is again +| <- punctuation.definition.blockquote -_ _ _ _ a -| <- meta.paragraph.markdown - meta.separator -|^^^^^^^^^ meta.paragraph.markdown - meta.separator +paragraph +| <- meta.paragraph -a------ -| <- meta.paragraph.markdown - meta.separator -|^^^^^^^ meta.paragraph.markdown - meta.separator +> > this is a nested quote but no code in a block quote +| <- punctuation.definition.blockquote +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown ----a--- -| <- meta.paragraph.markdown - meta.separator -|^^^^^^^ meta.paragraph.markdown - meta.separator +> > this is code in a block quote, not a nested quote +| <- punctuation.definition.blockquote +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block - markup.quote markup.quote -## https://spec.commonmark.org/0.30/#example-56 +> CommonMark expects following line to be indented code block (see: example 326) + > but all common parsers handle it as continued text. +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown - markup.raw +| ^ - punctuation - *-* -| <- meta.paragraph.markdown - meta.separator -|^^^ meta.paragraph.markdown - meta.separator +> Quoted fenced code block begin +> ``` +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm +| ^^^ punctuation.definition.raw.code-fence.begin.markdown -## https://spec.commonmark.org/0.30/#example-57 +> Quoted fenced code block language identifier +> ```C++ +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm +| ^^^ constant.other.language-name.markdown -- foo -*** -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -- bar +> Quoted fenced code block language identifier +> ```C++ info string +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^^^^^^^^^^^^^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm +| ^^^ constant.other.language-name.markdown +| ^^^^^^^^^^^^^ - constant + +> Quoted fenced code block content +> ``` +> code block +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^^^^^^^^ markup.quote.markdown markup.raw.code-fence.markdown-gfm + +> Quoted fenced code block end +> ``` +> ``` +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^ markup.quote.markdown meta.code-fence.definition.end.text.markdown-gfm +| ^^^ punctuation.definition.raw.code-fence.end.markdown + +> > 2nd level quoted fenced code block +> > ``` +> > code block ``` +> > ``` +| <- markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^ markup.quote.markdown markup.quote.markdown - meta.code-fence +| ^^^^ markup.quote.markdown markup.quote.markdown meta.code-fence.definition.end.text.markdown-gfm + +> Block quote followed by fenced code block +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown - meta.quote +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown - meta.quote + +> Quoted fenced code block is terminated by missing > at bol +> ``` +no code block +| <- meta.paragraph.markdown - meta.quote - meta.code-fence +|^^^^^^^^^^^^^ meta.paragraph.markdown - meta.quote - meta.code-fence + +> Quoted fenced code block is terminated by missing > at bol +> ``` +> content +no code block +| <- meta.paragraph.markdown - meta.quote - meta.code-fence +|^^^^^^^^^^^^^ meta.paragraph.markdown - meta.quote - meta.code-fence + +> Unterminated quoted fenced code block followed by unquoted fenced code block +> ``` +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm - markup.quote +``` +| <- meta.code-fence.definition.end.text.markdown-gfm - markup.quote + +> Block quote followed by heading +# heading +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^ markup.heading.1.markdown - meta.quote +| ^^^^^^^ entity.name.section.markdown + +> Block quote followed by list +* list item | <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote -## https://spec.commonmark.org/0.30/#example-58 +> Block quote followed by list ++ list item +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote -Foo +> Block quote followed by list +- list item +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote + +> Block quote followed by list +1. list item +| <- markup.list.numbered.bullet.markdown - punctuation +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^ markup.list.numbered.markdown - meta.quote + +> Block quote followed by thematic break *** -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -bar -| <- meta.paragraph.markdown +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote -## https://spec.commonmark.org/0.30/#example-59 +> Block quote followed by thematic break +- - - +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote -Foo ---- -| <- markup.heading.2.setext.markdown punctuation.definition.heading.setext.markdown -|^^ markup.heading.2.setext.markdown punctuation.definition.heading.setext.markdown -bar -| <- meta.paragraph.markdown -## https://spec.commonmark.org/0.30/#example-60 +# TEST: INDENTED CODE BLOCKS ################################################## -* Foo -* * * -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -|^^^^^ meta.separator.thematic-break.markdown -| ^ punctuation.definition.thematic-break.markdown -| ^ punctuation.definition.thematic-break.markdown -* Bar -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +Code block below: -## https://spec.commonmark.org/0.30/#example-61 + this is code! +| ^^^^^^^^^^^^^^^^ markup.raw.block -- Foo -- * * * -| ^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.separator.thematic-break.markdown + more code + spanning multiple lines +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block + +paragraph +| <- meta.paragraph # TEST: COMMONMARK AUTOLINKS ################################################## From a76430aaeafc347935dc622c1ee4718815c5cae1 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 14:48:55 +0100 Subject: [PATCH 13/63] Syntax: Add official CommonMark fenced code block tests This commit 1. adds all CommonMark 0.30.0 tests (except 126,127). 2. organizes all existing fenced code block tests within the TEST: FENCED CODEBLOCKS section. 3. moves the section upwards so it follows indented code blocks --- tests/syntax_test_markdown.md | 1220 +++++++++++++++++++++------------ 1 file changed, 786 insertions(+), 434 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 3e64335f..d1316e63 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1621,6 +1621,725 @@ paragraph | <- meta.paragraph +# TEST: FENCED CODE BLOCKS #################################################### + +## https://spec.commonmark.org/0.30/#example-119 + +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +< +| <- markup.raw.code-fence.markdown-gfm - punctuation + > +|^^ markup.raw.code-fence.markdown-gfm - punctuation +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-120 + +~~~ +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +< +| <- markup.raw.code-fence.markdown-gfm - punctuation + > +|^^ markup.raw.code-fence.markdown-gfm - punctuation +~~~ +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-121 + +`` +foo +`` +| <- - meta.code-fence - punctuation.definition.raw.code-fence +|^ - meta.code-fence - punctuation.definition.raw.code-fence + +## https://spec.commonmark.org/0.30/#example-122 + +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +aaa +~~~ +| <- markup.raw.code-fence.markdown-gfm - punctuation +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-123 + +~~~ +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +aaa +``` +| <- markup.raw.code-fence.markdown-gfm - punctuation +~~~ +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +~~~~ +| <- punctuation.definition.raw.code-fence.begin + ~~~~ +| ^^^ punctuation.definition.raw.code-fence.end + +## https://spec.commonmark.org/0.30/#example-124 + +```` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +aaa +``` +| <- markup.raw.code-fence.markdown-gfm - punctuation +`````` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-125 + +~~~~ +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +| +aaa +~~~ +| <- markup.raw.code-fence.markdown-gfm - punctuation +~~~~ +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-128 + +> ``` +> aaa +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - markup.raw +| ^^^^ markup.quote.markdown markup.raw.code-fence.markdown-gfm + +bbb +| <- meta.paragraph.markdown - markup.raw + +## https://spec.commonmark.org/0.30/#example-129 + +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation + + +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-130 + +``` +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-131 + + ``` + aaa +aaa +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-132 + + ``` +aaa + aaa +aaa + ``` +| <- meta.code-fence.definition.end.text.markdown-gfm - punctuation +|^ meta.code-fence.definition.end.text.markdown-gfm - punctuation +| ^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-133 + + ``` + aaa + aaa + aaa + ``` +| <- meta.code-fence.definition.end.text.markdown-gfm - punctuation +|^^ meta.code-fence.definition.end.text.markdown-gfm - punctuation +| ^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-134 + + ``` + aaa + ``` +| <- markup.raw.block.markdown +|^^^^^^^ markup.raw.block.markdown - punctuation + +## https://spec.commonmark.org/0.30/#example-135 + +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +aaa +| <- markup.raw.code-fence.markdown-gfm + ``` +| <- meta.code-fence.definition.end.text.markdown-gfm - punctuation +|^ meta.code-fence.definition.end.text.markdown-gfm - punctuation +| ^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-136 + + ``` +| <- meta.code-fence.definition.begin.text.markdown-gfm - punctuation +|^^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +| ^^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +aaa +| <- markup.raw.code-fence.markdown-gfm + ``` +| <- meta.code-fence.definition.end.text.markdown-gfm - punctuation +|^ meta.code-fence.definition.end.text.markdown-gfm - punctuation +| ^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-137 + +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +aaa +| <- markup.raw.code-fence.markdown-gfm + ``` +| <- meta.code-fence.definition.end.text.markdown-gfm - punctuation +|^^^ meta.code-fence.definition.end.text.markdown-gfm - punctuation +| ^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-138 + +``` ``` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^ markup.raw.inline.markdown + +``` ``` +aaa +| <- meta.paragraph.markdown - meta.code-fence - markup +|^^ meta.paragraph.markdown - meta.code-fence - markup + +## https://spec.commonmark.org/0.30/#example-139 + +~~~~~~ +aaa +~~~ ~~ +| <- markup.raw.code-fence.markdown-gfm - punctuation +|^^^^^^ markup.raw.code-fence.markdown-gfm - punctuation + +~~~~~~ +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.text.markdown-gfm - punctuation + +## https://spec.commonmark.org/0.30/#example-140 + +foo +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +bar +``` +baz +| <- meta.paragraph.markdown - meta.code-fence - markup +|^^ meta.paragraph.markdown - meta.code-fence - markup + +## https://spec.commonmark.org/0.30/#example-140-including-emphasis-termination + +Paragraph is terminated by fenced code blocks. +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +Code blocks terminate **bold text +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +this must not be bold** +| <- - meta.bold +|^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold + +Code blocks terminate __bold text +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +this must not be bold__ +| <- - meta.bold +|^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold + +Code blocks terminate *italic text +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +this must not be italic* +| <- - meta.italic +|^^^^^^^^^^^^^^^^^^^^^^^ - meta.italic + +Code blocks terminate _italic text +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +this must not be italic_ +| <- - meta.italic +|^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - meta.italic + +Code blocks terminate ***bold italic text +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +this must not be bold italic*** +| <- - meta.bold - meta.italic +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - meta.italic + +Code blocks terminate ___bold italic text +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +this must not be bold italic___ +| <- - meta.bold - meta.italic +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - meta.italic + +Code blocks terminate **_bold italic text +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +this must not be bold italic_** +| <- - meta.bold - meta.italic +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - meta.italic + +## https://spec.commonmark.org/0.30/#example-141 + +foo +--- +~~~ +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +bar +|^^^ markup.raw.code-fence.markdown-gfm +~~~ +# baz +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.1.markdown + +## https://spec.commonmark.org/0.30/#example-142 + +```ruby +| <- meta.code-fence.definition.begin.ruby.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.ruby.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^^^ meta.code-fence.definition.begin.ruby.markdown-gfm constant.other.language-name.markdown +| ^ meta.code-fence.definition.begin.ruby.markdown-gfm - constant +def foo(x) +| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby meta.function.ruby keyword.declaration.function.ruby + return 3 +end +| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby keyword.control.block.end.ruby +``` +| <- meta.code-fence.definition.end.ruby.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.ruby.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +## https://spec.commonmark.org/0.30/#example-143 + +~~~~ ruby startline=3 $%@#$ +| <- meta.code-fence.definition.begin.ruby.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^^ meta.code-fence.definition.begin.ruby.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^^^ meta.code-fence.definition.begin.ruby.markdown-gfm - punctuation - constant +| ^^^^ meta.code-fence.definition.begin.ruby.markdown-gfm constant.other.language-name.markdown +| ^^^^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.ruby.markdown-gfm - constant +def foo(x) +| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby meta.function.ruby keyword.declaration.function.ruby + return 3 +end +| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby keyword.control.block.end.ruby +~~~~~~~ +| <- meta.code-fence.definition.end.ruby.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^^^^^ meta.code-fence.definition.end.ruby.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +## https://spec.commonmark.org/0.30/#example-144 + +````; +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^ meta.code-fence.definition.begin.text.markdown-gfm +```` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +## https://spec.commonmark.org/0.30/#example-145 + +``` aa ``` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^^^ meta.paragraph.markdown markup.raw.inline.markdown +|^^ punctuation.definition.raw.begin.markdown +| ^^^ punctuation.definition.raw.end.markdown +foo +| <- meta.paragraph.markdown - markup + +## https://spec.commonmark.org/0.30/#example-146 + +~~~ aa ``` ~~~ +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^ meta.code-fence.definition.begin.text.markdown-gfm constant.other.language-name.markdown +| ^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation +foo +~~~ +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +~~~~~foo~ +|^^^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^^^ meta.code-fence.definition.begin.text.markdown-gfm constant.other.language-name.markdown + +~~~~~ +|^^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +## https://spec.commonmark.org/0.30/#example-147 + +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +``` aaa +| <- markup.raw.code-fence.markdown-gfm - punctuation +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +## https://fenced-code-block-embedded-syntaxes-tests + +```bash +# test +| ^^^^^ source.shell comment.line.number-sign +echo hello, \ +| ^^ punctuation.separator.continuation.line +echo This is a smiley :-\) \(I have to escape the parentheses, though!\) +| ^^ constant.character.escape +``` +| <- meta.code-fence.definition.end.shell-script punctuation.definition.raw.code-fence.end +|^^ meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```clojure +|^^^^^^^^^ meta.code-fence.definition.begin.clojure +| ^^^^^^^ constant.other.language-name + (/ 10 3.0) +| <- source.clojure +|^^^^^^^^^^ source.clojure +``` +| <- meta.code-fence.definition.end.clojure.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.clojure.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```cmd + +| <- markup.raw.code-fence.dosbatch.markdown-gfm source.dosbatch +``` +| <- meta.code-fence.definition.end.dosbatch.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.dosbatch.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```css + +| <- markup.raw.code-fence.css.markdown-gfm source.css +``` +| <- meta.code-fence.definition.end.css.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.css.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```diff ++ inserted +| <- source.diff markup.inserted.diff punctuation.definition.inserted.diff +- deleted +| <- source.diff markup.deleted.diff punctuation.definition.deleted.diff +``` +| <- meta.code-fence.definition.end.diff.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.diff.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```Graphviz +graph n {} +| ^^^ storage.type.dot +``` +| <- meta.code-fence.definition.end.graphviz.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.graphviz.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```haskell + +| <- markup.raw.code-fence.haskell.markdown-gfm source.haskell +``` +| <- meta.code-fence.definition.end.haskell.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.haskell.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```html + +| <- markup.raw.code-fence.html.markdown-gfm text.html +| ^^^^^^ text.html meta.tag +``` +| <- meta.code-fence.definition.end.html.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.html.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```html+php +
+|^^^ entity.name.tag.block.any.html + +|^^^^^^^^^^^^^^^^^^^^^^ markup.raw.code-fence.xml +| ^^^^^^^ meta.tag.preprocessor.xml entity.other.attribute-name.localname.xml + + + +``` +| <- meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```R%&?! weired language name +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +| ^^^^^ constant.other.language-name.markdown +| ^^^^^^^^^^^^^^^^^^^^^ - constant +``` + +```{key: value} +|^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +| ^^^^^^^^^^^^ - constant +``` + +``` {key: value} +|^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +| ^^^^^^^^^^^^ - constant +``` + + +# TEST: CODE SPANS ############################################################ + +```testing``123``` +| <- punctuation.definition.raw.begin +| ^^ - punctuation +| ^^^ punctuation.definition.raw.end + +```testing``123```` +| <- punctuation.definition.raw.begin +| ^ - punctuation +| ^^^^ - punctuation +``` +| <- punctuation.definition.raw.end + +``testing`123```` +| <- punctuation.definition.raw.begin +| ^ - punctuation +| ^^^^ - punctuation +more text`` +| ^^ punctuation.definition.raw.end + +``text + +| <- invalid.illegal.non-terminated.raw +text +| <- - markup.raw + +## http://spec.commonmark.org/0.28/#example-315 + +`` foo ` bar `` +|^ punctuation.definition.raw.begin +|^^^^^^^^^^^^^^^ markup.raw.inline +| ^ - punctuation +| ^^ punctuation.definition.raw.end + +## http://spec.commonmark.org/0.28/#example-316 + +` `` ` +|<- punctuation.definition.raw.begin +|^^^^^ markup.raw.inline +| ^^ - punctuation +| ^ punctuation.definition.raw.end + +## http://spec.commonmark.org/0.28/#example-318 + +`foo bar + baz` +|^^^^^ markup.raw.inline +| ^ punctuation.definition.raw.end + +hello world ````test```` +| ^^^^^^^^^^^^ markup.raw.inline +| ^ - markup.raw + +`foo `` bar` +| ^^^^^^ markup.raw.inline - punctuation +| ^ punctuation.definition.raw.end + + # TEST: COMMONMARK AUTOLINKS ################################################## @@ -2796,270 +3515,82 @@ __~~bold striked~~__ | ^^ markup.bold.markdown - markup.strikethrough |^ punctuation.definition.bold.begin.markdown | ^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^^ punctuation.definition.bold.end.markdown - -_~~italic striked~~_ -| <- markup.italic.markdown punctuation.definition.italic.begin.markdown -|^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.strikethrough.markdown-gfm -| ^ markup.italic.markdown - markup.strikethrough -|^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^ punctuation.definition.italic.end.markdown - -*~~italic striked~~* -| <- markup.italic.markdown punctuation.definition.italic.begin.markdown -|^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.strikethrough.markdown-gfm -| ^ markup.italic.markdown - markup.strikethrough -|^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^ punctuation.definition.italic.end.markdown - -___~~bold italic striked~~___ -| <- markup.bold.markdown punctuation.definition.bold.begin.markdown -|^ markup.bold.markdown - markup.italic - markup.strikethrough -| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough -| ^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.strikethrough.markdown-gfm -| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough -| ^^ markup.bold.markdown - markup.italic - markup.strikethrough -|^ punctuation.definition.bold.begin.markdown -| ^ punctuation.definition.italic.begin.markdown -| ^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^ punctuation.definition.italic.end.markdown -| ^^ punctuation.definition.bold.end.markdown - -***~~bold italic striked~~*** -| <- markup.bold.markdown punctuation.definition.bold.begin.markdown -|^ markup.bold.markdown - markup.italic - markup.strikethrough -| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough -| ^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.strikethrough.markdown-gfm -| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough -| ^^ markup.bold.markdown - markup.italic - markup.strikethrough -|^ punctuation.definition.bold.begin.markdown -| ^ punctuation.definition.italic.begin.markdown -| ^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^ punctuation.definition.italic.end.markdown -| ^^ punctuation.definition.bold.end.markdown - -~Hi~ Hello, world! -| <- - punctuation.definition.strikethrough -|^^^^^^^^^^^^^^^^^ meta.paragraph - markup -| ^ - punctuation.definition.strikethrough - -This ~text~~~~ is ~~~~curious~. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - markup -| ^ - punctuation.definition.strikethrough -| ^^^^ - punctuation.definition.strikethrough -| ^^^^ - punctuation.definition.strikethrough -| ^ - punctuation.definition.strikethrough - -This ~~text~~~~ is ~~~~curious~~. -|^^^^ meta.paragraph - markup -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph markup.strikethrough -| ^^ meta.paragraph - markup -| ^^ punctuation.definition.strikethrough.begin -| ^^^^ - punctuation.definition.strikethrough -| ^^^^ - punctuation.definition.strikethrough -| ^^ punctuation.definition.strikethrough.end - -This ~~has a -| ^^^^^^^^ meta.paragraph markup.strikethrough - -| <- meta.paragraph markup.strikethrough invalid.illegal.non-terminated.bold-italic -new paragraph~~. -| ^^ meta.paragraph markup.strikethrough punctuation.definition.strikethrough.begin - -| <- invalid.illegal.non-terminated.bold-italic - - -# TEST: FENCED CODE BLOCKS #################################################### - -Paragraph is terminated by fenced code blocks. -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown - -Code blocks terminate **bold text -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -this must not be bold** -| <- - meta.bold -|^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - -Code blocks terminate __bold text -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -this must not be bold__ -| <- - meta.bold -|^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - -Code blocks terminate *italic text -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -this must not be italic* -| <- - meta.italic -|^^^^^^^^^^^^^^^^^^^^^^^ - meta.italic - -Code blocks terminate _italic text -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -this must not be italic_ -| <- - meta.italic -|^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - meta.italic - -Code blocks terminate ***bold italic text -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -this must not be bold italic*** -| <- - meta.bold - meta.italic -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - meta.italic - -Code blocks terminate ___bold italic text -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -this must not be bold italic___ -| <- - meta.bold - meta.italic -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - meta.italic - -Code blocks terminate **_bold italic text -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -this must not be bold italic_** -| <- - meta.bold - meta.italic -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.bold - meta.italic - -```js -| <- punctuation.definition.raw.code-fence.begin -| ^^ constant.other.language-name -for (var i = 0; i < 10; i++) { -| ^ source.js keyword.control.loop - console.log(i); -} -``` -| <- punctuation.definition.raw.code-fence.end - -```ts -| ^^ constant.other.language-name -declare type foo = 'bar' -``` - -```R%&?! weired language name -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -| ^^^^^ constant.other.language-name.markdown -| ^^^^^^^^^^^^^^^^^^^^^ - constant -``` - -```{key: value} -|^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -| ^^^^^^^^^^^^ - constant -``` - -``` {key: value} -|^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -| ^^^^^^^^^^^^ - constant -``` - -```testing``123``` -| <- punctuation.definition.raw.begin -| ^^ - punctuation -| ^^^ punctuation.definition.raw.end -```testing``123```` -| <- punctuation.definition.raw.begin -| ^ - punctuation -| ^^^^ - punctuation -``` -| <- punctuation.definition.raw.end -``testing`123```` -| <- punctuation.definition.raw.begin -| ^ - punctuation -| ^^^^ - punctuation -more text`` -| ^^ punctuation.definition.raw.end -``text - -| <- invalid.illegal.non-terminated.raw -text -| <- - markup.raw - -http://spec.commonmark.org/0.28/#example-315 -`` foo ` bar `` -|^ punctuation.definition.raw.begin -|^^^^^^^^^^^^^^^ markup.raw.inline -| ^ - punctuation -| ^^ punctuation.definition.raw.end - -http://spec.commonmark.org/0.28/#example-316 -` `` ` -|<- punctuation.definition.raw.begin -|^^^^^ markup.raw.inline -| ^^ - punctuation -| ^ punctuation.definition.raw.end +| ^^ punctuation.definition.strikethrough.end.markdown +| ^^ punctuation.definition.bold.end.markdown -http://spec.commonmark.org/0.28/#example-318 -`foo bar - baz` -|^^^^^ markup.raw.inline -| ^ punctuation.definition.raw.end +_~~italic striked~~_ +| <- markup.italic.markdown punctuation.definition.italic.begin.markdown +|^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.strikethrough.markdown-gfm +| ^ markup.italic.markdown - markup.strikethrough +|^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^ punctuation.definition.italic.end.markdown -~~~~ -| <- punctuation.definition.raw.code-fence.begin - ~~~~ -| ^^^ punctuation.definition.raw.code-fence.end +*~~italic striked~~* +| <- markup.italic.markdown punctuation.definition.italic.begin.markdown +|^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.strikethrough.markdown-gfm +| ^ markup.italic.markdown - markup.strikethrough +|^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^ punctuation.definition.italic.end.markdown -~~~~~test~ -|^^^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -| ^^^^^ meta.code-fence.definition.begin.text.markdown-gfm constant.other.language-name.markdown +___~~bold italic striked~~___ +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.italic - markup.strikethrough +| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough +| ^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.strikethrough.markdown-gfm +| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough +| ^^ markup.bold.markdown - markup.italic - markup.strikethrough +|^ punctuation.definition.bold.begin.markdown +| ^ punctuation.definition.italic.begin.markdown +| ^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^ punctuation.definition.italic.end.markdown +| ^^ punctuation.definition.bold.end.markdown -~~~~~ -|^^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +***~~bold italic striked~~*** +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.italic - markup.strikethrough +| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough +| ^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.strikethrough.markdown-gfm +| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough +| ^^ markup.bold.markdown - markup.italic - markup.strikethrough +|^ punctuation.definition.bold.begin.markdown +| ^ punctuation.definition.italic.begin.markdown +| ^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^ punctuation.definition.italic.end.markdown +| ^^ punctuation.definition.bold.end.markdown -~~~~~~test -| ^^^^ punctuation.definition.raw.code-fence.begin -| ^^^^ constant.other.language-name -~~~~~~ -| ^^^^ punctuation.definition.raw.code-fence.end +~Hi~ Hello, world! +| <- - punctuation.definition.strikethrough +|^^^^^^^^^^^^^^^^^ meta.paragraph - markup +| ^ - punctuation.definition.strikethrough -# https://spec.commonmark.org/0.30/#example-146 +This ~text~~~~ is ~~~~curious~. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - markup +| ^ - punctuation.definition.strikethrough +| ^^^^ - punctuation.definition.strikethrough +| ^^^^ - punctuation.definition.strikethrough +| ^ - punctuation.definition.strikethrough -~~~ aa ``` ~~~ -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -|^^ meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -| ^^ meta.code-fence.definition.begin.text.markdown-gfm constant.other.language-name.markdown -| ^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm - punctuation -foo -~~~ -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -|^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +This ~~text~~~~ is ~~~~curious~~. +|^^^^ meta.paragraph - markup +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph markup.strikethrough +| ^^ meta.paragraph - markup +| ^^ punctuation.definition.strikethrough.begin +| ^^^^ - punctuation.definition.strikethrough +| ^^^^ - punctuation.definition.strikethrough +| ^^ punctuation.definition.strikethrough.end -```test -| ^^^^ constant.other.language-name - ``` -| ^^^ punctuation.definition.raw.code-fence.end +This ~~has a +| ^^^^^^^^ meta.paragraph markup.strikethrough -hello world ````test```` -| ^^^^^^^^^^^^ markup.raw.inline -| ^ - markup.raw +| <- meta.paragraph markup.strikethrough invalid.illegal.non-terminated.bold-italic +new paragraph~~. +| ^^ meta.paragraph markup.strikethrough punctuation.definition.strikethrough.begin -`foo `` bar` -| ^^^^^^ markup.raw.inline - punctuation -| ^ punctuation.definition.raw.end +| <- invalid.illegal.non-terminated.bold-italic hard line break | ^^ meta.hard-line-break punctuation.definition.hard-line-break @@ -3725,186 +4256,7 @@ okay 1. Test 2 |^ markup.list.numbered.bullet punctuation.definition.list_item -```clojure -|^^^^^^^^^ meta.code-fence.definition.begin.clojure -| ^^^^^^^ constant.other.language-name - (/ 10 3.0) -|<- source.clojure -|^^^^^^^^^^ source.clojure -``` -|^^ meta.code-fence.definition.end.clojure punctuation.definition.raw.code-fence.end - -```cmd - -| <- markup.raw.code-fence.dosbatch.markdown-gfm source.dosbatch -``` - -```css - -| <- markup.raw.code-fence.css.markdown-gfm source.css -``` - -```diff -+ inserted -| <- source.diff markup.inserted.diff punctuation.definition.inserted.diff -- deleted -| <- source.diff markup.deleted.diff punctuation.definition.deleted.diff -``` - -```haskell - -| <- markup.raw.code-fence.haskell.markdown-gfm source.haskell -``` - -```html - -| <- markup.raw.code-fence.html.markdown-gfm text.html -| ^^^^^^ text.html meta.tag -``` - -```jsx - -| <- markup.raw.code-fence.jsx.markdown-gfm -``` - -```lisp - -| <- markup.raw.code-fence.lisp.markdown-gfm source.lisp -``` - -```lua - -| <- markup.raw.code-fence.lua.markdown-gfm source.lua -``` - -```matlab - -| <- markup.raw.code-fence.matlab.markdown-gfm source.matlab -``` - -```ocaml - -| <- markup.raw.code-fence.ocaml.markdown-gfm source.ocaml -``` - -```scala - -| <- markup.raw.code-fence.scala.markdown-gfm source.scala -``` - -```sh - -| <- markup.raw.code-fence.shell-script.markdown-gfm source.shell.bash -``` - -```shell - -| <- markup.raw.code-fence.shell-script.markdown-gfm source.shell.bash -``` - -```shell-script - -| <- markup.raw.code-fence.shell-script.markdown-gfm source.shell.bash -``` - -```tsx - -| <- markup.raw.code-fence.tsx.markdown-gfm -``` - -```xml -|^^^^^ meta.code-fence.definition.begin.xml -| ^^^ constant.other.language-name - -|^^^^^^^^^^^^^^^^^^^^^^ markup.raw.code-fence.xml -| ^^^^^^^ meta.tag.preprocessor.xml entity.other.attribute-name.localname.xml - - - -``` -|^^ punctuation.definition.raw.code-fence.end - -```sql -|^^^^^ meta.code-fence.definition.begin.sql -| ^^^ constant.other.language-name -SELECT TOP 10 * -|^^^^^^^^^^^^^^^ markup.raw.code-fence.sql source.sql -FROM TableName -``` -|^^ meta.code-fence.definition.end.sql punctuation.definition.raw.code-fence.end - markup - -```python -|^^ punctuation.definition.raw.code-fence.begin -|^^^^^^^^^ meta.code-fence.definition.begin.python - markup -| ^^^^^^ constant.other.language-name -def function(): - pass -| ^^^^ keyword.control.flow -unclosed_paren = ( -| ^ meta.group.python punctuation.section.group.begin.python -``` -|^^ meta.code-fence.definition.end.python punctuation.definition.raw.code-fence.end - -```Graphviz -graph n {} -| ^^^ storage.type.dot -``` - -| <- - markup.raw - -```php -var_dump(expression); -| ^^^^^^ support.function.var.php -``` - -```html+php -
-|^^^ entity.name.tag.block.any.html -= => <=> // && == != +-= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != From 105060505e933629117c97a8ccac34fd25b23157 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 15:30:16 +0100 Subject: [PATCH 14/63] Syntax: Add official CommonMark code span tests --- tests/syntax_test_markdown.md | 212 ++++++++++++++++++++++++---------- 1 file changed, 151 insertions(+), 61 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index d1316e63..02fefdb4 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1050,11 +1050,6 @@ A [link](https://example.com){ :_attr = value }, *italic text* and **bold**. | ^^^^^^^^ markup.bold | ^^ punctuation.definition.bold -Inline `code sample`. -| ^^^^^^^^^^^^^ markup.raw.inline -| ^ punctuation.definition.raw -| ^ punctuation.definition.raw - Here is a [](https://example.com). | ^^ meta.link.inline | ^ punctuation.definition.link.begin @@ -2308,36 +2303,171 @@ more text`` text | <- - markup.raw -## http://spec.commonmark.org/0.28/#example-315 +## https://spec.commonmark.org/0.30/#example-327 + +`hi`lo` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown +| ^^ - markup.raw + +## https://spec.commonmark.org/0.30/#example-328 + +`foo` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^ meta.paragraph.markdown markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-329 `` foo ` bar `` -|^ punctuation.definition.raw.begin -|^^^^^^^^^^^^^^^ markup.raw.inline +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^^^^^^^^^ markup.raw.inline.markdown +|^ punctuation.definition.raw.begin.markdown | ^ - punctuation -| ^^ punctuation.definition.raw.end +| ^^ punctuation.definition.raw.end.markdown -## http://spec.commonmark.org/0.28/#example-316 +## https://spec.commonmark.org/0.30/#example-330 ` `` ` -|<- punctuation.definition.raw.begin -|^^^^^ markup.raw.inline +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^ markup.raw.inline.markdown | ^^ - punctuation -| ^ punctuation.definition.raw.end +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-331 + +` `` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^ markup.raw.inline.markdown +| ^^ - punctuation +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-332 + +` a` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-333 + +` b ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-334 + +` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown +| ^ - markup + +` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown +| ^ - markup + +## https://spec.commonmark.org/0.30/#example-335 + +`` +foo +bar +baz +`` +| <- markup.raw.inline.markdown punctuation.definition.raw.end.markdown +|^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-336 + +`` +foo +`` +| <- markup.raw.inline.markdown punctuation.definition.raw.end.markdown +|^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown -## http://spec.commonmark.org/0.28/#example-318 +## https://spec.commonmark.org/0.30/#example-337 `foo bar baz` -|^^^^^ markup.raw.inline -| ^ punctuation.definition.raw.end +|^^^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown -hello world ````test```` -| ^^^^^^^^^^^^ markup.raw.inline -| ^ - markup.raw +## https://spec.commonmark.org/0.30/#example-338 + +`foo\`bar` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^ markup.raw.inline.markdown +| ^^^ - markup.raw + +## https://spec.commonmark.org/0.30/#example-339 + +``foo`bar`` +| <- meta.paragraph.markdown markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^^^^ meta.paragraph.markdown markup.raw.inline.markdown +|^ punctuation.definition.raw.begin.markdown +| ^^^^^^^ - punctuation +| ^^ punctuation.definition.raw.end.markdown + +````bar```` baz +|^^^^^^^^^^ markup.raw.inline.markdown +| ^^^^^ - markup.raw + +## https://spec.commonmark.org/0.30/#example-340 `foo `` bar` -| ^^^^^^ markup.raw.inline - punctuation -| ^ punctuation.definition.raw.end +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^^^^ markup.raw.inline.markdown - punctuation +| ^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-341 + +*foo`*` +| <- markup.italic.markdown punctuation.definition.italic.begin.markdown +| ^^^ markup.italic.markdown markup.raw.inline.markdown + +| <- invalid.illegal.non-terminated.bold-italic + +## https://spec.commonmark.org/0.30/#example-342 + +[not a `link](/foo`) +|^^^^^^^^^^^^^^^^^^^ - meta.link +| ^^^^^^^^^^^^ markup.raw.inline.markdown + +## https://spec.commonmark.org/0.30/#example-343 + +`
` +|^^^^^^^^^^ markup.raw.inline.markdown +| ^^ - markup.raw + +| <- invalid.illegal.non-terminated.raw + +## https://spec.commonmark.org/0.30/#example-344 + +` +| ^^^^^^^^^ meta.tag.inline.a +| ^ punctuation.definition.raw.begin + +| <- invalid.illegal.non-terminated.raw + +## https://spec.commonmark.org/0.30/#example-345 + +`` +|^^^^^^^^^^^^^^^^^ markup.raw.inline +| ^ punctuation.definition.raw.begin + +| <- invalid.illegal.non-terminated.raw + +## https://spec.commonmark.org/0.30/#example-346 + +` +|^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.raw.begin + +| <- invalid.illegal.non-terminated.raw # TEST: COMMONMARK AUTOLINKS ################################################## @@ -2950,46 +3080,6 @@ This is a ![reference] [] | ^ - meta.link | ^^ meta.link.reference -http://spec.commonmark.org/0.28/#example-322 -*foo`*` -|^^^^^^^ markup.italic -| ^^^ markup.raw.inline - -| <- invalid.illegal.non-terminated.bold-italic - -http://spec.commonmark.org/0.28/#example-323 -[not a `link](/foo`) -|^^^^^^^^^^^^^^^^^^^ - meta.link -| ^^^^^^^^^^^^ markup.raw.inline - -http://spec.commonmark.org/0.28/#example-324 -`` -|^^^^^^^^^^ markup.raw.inline -| ^^ - markup.raw - -| <- invalid.illegal.non-terminated.raw - -http://spec.commonmark.org/0.28/#example-325 -` -| ^^^^^^^^^ meta.tag.inline.a -| ^ punctuation.definition.raw.begin - -| <- invalid.illegal.non-terminated.raw - -http://spec.commonmark.org/0.28/#example-326 -`` -|^^^^^^^^^^^^^^^^^ markup.raw.inline -| ^ punctuation.definition.raw.begin - -| <- invalid.illegal.non-terminated.raw - -http://spec.commonmark.org/0.28/#example-327 -` -|^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.raw.begin - -| <- invalid.illegal.non-terminated.raw - http://spec.commonmark.org/0.27/#example-328 *foo bar* | <- punctuation.definition.italic.begin From 39273ede737e6822ba7fdcdc944f4da85b7a7a98 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 15:51:52 +0100 Subject: [PATCH 15/63] Syntax: Reorganize ligature tests --- tests/syntax_test_markdown.md | 103 +++++++++++++++++----------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 02fefdb4..2bf6d0f0 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -96,6 +96,58 @@ _ _ _ | ^ punctuation.definition.thematic-break.markdown +# TEST: LIGATURES ############################################################# + +this is a raw ampersand & does not require HTML escaping +| ^ - entity - illegal + +this is a raw bracket < > does not require HTML escaping +| ^^^ - meta.tag - punctuation + +these are raw ligatures << <<< <<<< <<<<< >>>>> >>>> >>> >> +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +these are raw ligatures <- <-- <--- <---- <-< <--< <---< <----< +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +these are raw ligatures -> --> ---> ----> >-> >--> >---> >----> +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +these are raw ligatures >- >-- >--- >---- ----< ---< --< -< +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +these are raw ligatures >< >-< >--< >---< <---> <--> <-> <> +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +these are raw ligatures <= <== <=== <==== <=< <==< <===< <====< +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +these are raw ligatures => ==> ===> ====> >=> >==> >===> >====> +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +these are raw ligatures >= >== >=== >==== ====< ===< ==< =< +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +these are raw ligatures >< >=< >==< >===< <===> <==> <=> <> +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +these are raw ligatures - -- --- ---- ----- ===== ==== === == = +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + +-= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable + + -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw - constant - keyword - variable - punctuation + +> -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable + +> > -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != +| ^ markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable + + # TEST: BACKSLASH ESCAPES ##################################################### ## https://spec.commonmark.org/0.30/#example-12 @@ -2715,44 +2767,6 @@ a.b-c_d@a.b. |^^^^^^^^^^^^^ - meta.link - markup.underline.link -# TEST: LIGATURES ############################################################# - -this is a raw ampersand & does not require HTML escaping -| ^ - entity - illegal - -this is a raw bracket < > does not require HTML escaping -| ^^^ - meta.tag - punctuation - -these are raw ligatures << <<< <<<< <<<<< >>>>> >>>> >>> >> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - -these are raw ligatures <- <-- <--- <---- <-< <--< <---< <----< -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - -these are raw ligatures -> --> ---> ----> >-> >--> >---> >----> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - -these are raw ligatures >- >-- >--- >---- ----< ---< --< -< -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - -these are raw ligatures >< >-< >--< >---< <---> <--> <-> <> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - -these are raw ligatures <= <== <=== <==== <=< <==< <===< <====< -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - -these are raw ligatures => ==> ===> ====> >=> >==> >===> >====> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - -these are raw ligatures >= >== >=== >==== ====< ===< ==< =< -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - -these are raw ligatures >< >=< >==< >===< <===> <==> <=> <> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - -these are raw ligatures - -- --- ---- ----- ===== ==== === == = -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - [2]: https://github.com/sublimehq/Packages "Packages Repo" | <- meta.link.reference.def.markdown |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown @@ -4346,19 +4360,6 @@ okay 1. Test 2 |^ markup.list.numbered.bullet punctuation.definition.list_item --= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable - - -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw - constant - keyword - variable - punctuation - -> -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable - -> > -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != -| ^ markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable - link with a single underscore inside the text : [@_test](http://example.com) | ^^^^^^ meta.paragraph meta.link.inline.description - punctuation.definition | ^ meta.paragraph meta.link.inline punctuation.definition.link.end From 9dd15c74820a35e1900ff23b22077aa8d0d5cae1 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 16:22:03 +0100 Subject: [PATCH 16/63] Syntax: Update HTML block tests Updates example urls and adds further tests which have not yet been present. Tests for incomplete tags (157-129) are skipped as they require end of document to be followed. --- tests/syntax_test_markdown.md | 823 +++++++++++++++++++++------------- 1 file changed, 515 insertions(+), 308 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 2bf6d0f0..03d4da6f 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1425,64 +1425,6 @@ Paragraph break. | ^ punctuation.separator.key-value | ^^^^^^^^^^^^^^^^^^ markup.underline.link -
this is HTML until there are two blank lines
-| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -disabled markdown -| <- meta.disable-markdown - -non-disabled markdown -| <- - meta.disable-markdown - -
this is HTML until there are two blank lines -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -still HTML -| ^^^^ meta.tag.inline.any.html entity.name.tag.inline.any.html -
-| ^^^^ meta.disable-markdown - -non-disabled markdown -| <- - meta.disable-markdown - -
nested tags don't count 
test
-| ^^^^^^ meta.disable-markdown meta.tag.block.any.html -non-disabled markdown -| <- - meta.disable-markdown - -
nested tags don't count
test -| ^^^^^ meta.disable-markdown -
-| ^^^ meta.disable-markdown entity.name.tag.block.any.html - -non-disabled markdown -| <- - meta.disable-markdown - -
two blank lines needed
to stop disabled markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -disabled markdown -| <- meta.disable-markdown - -non-disabled markdown -| <- - meta.disable-markdown - -
another
disable test -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -| ^^^^^^ meta.tag.inline.any.html -disabled markdown -| <- meta.disable-markdown - -non-disabled markdown -| <- - meta.disable-markdown - -*a* -| ^ markup.italic -

*a*

-| ^^^^^^^^^ meta.disable-markdown - markup.italic -*a* -| ^^ meta.disable-markdown - -non-disabled markdown -| <- - meta.disable-markdown - # TEST: BLOCK QUOTES ########################################################## @@ -2267,65 +2209,530 @@ unclosed_paren = ( | <- meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown |^^ meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -```shell-script +```shell-script + +| <- markup.raw.code-fence.shell-script.markdown-gfm source.shell.bash +``` +| <- meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```sql +|^^^^^ meta.code-fence.definition.begin.sql +| ^^^ constant.other.language-name +SELECT TOP 10 * +|^^^^^^^^^^^^^^^ markup.raw.code-fence.sql source.sql +FROM TableName +``` +| <- meta.code-fence.definition.end.sql.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.sql.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```ts +declare type foo = 'bar' +| <- markup.raw.code-fence.typescript.markdown-gfm source.ts +``` +| <- meta.code-fence.definition.end.typescript.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.typescript.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```tsx + +| <- markup.raw.code-fence.tsx.markdown-gfm +``` +| <- meta.code-fence.definition.end.tsx.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.tsx.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```xml +|^^^^^ meta.code-fence.definition.begin.xml +| ^^^ constant.other.language-name + +|^^^^^^^^^^^^^^^^^^^^^^ markup.raw.code-fence.xml +| ^^^^^^^ meta.tag.preprocessor.xml entity.other.attribute-name.localname.xml + + + +``` +| <- meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +```R%&?! weired language name +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +| ^^^^^ constant.other.language-name.markdown +| ^^^^^^^^^^^^^^^^^^^^^ - constant +``` + +```{key: value} +|^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +| ^^^^^^^^^^^^ - constant +``` + +``` {key: value} +|^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +| ^^^^^^^^^^^^ - constant +``` + + +# TEST: HTML BLOCKS ########################################################### + +## https://spec.commonmark.org/0.30/#example-148 + +
+
+**Hello**,
+| ^^^^^^^^^ meta.disable-markdown - markup
+
+_world_.
+| ^^^^ markup.italic - meta.disable-markdown
+
+
+ +## https://spec.commonmark.org/0.30/#example-149 + + + + + +
+ hi +|^^^^^^^^^^^^^ meta.disable-markdown +
+ +okay. +| <- meta.paragraph.markdown +|^^^^^ meta.paragraph.markdown + +## https://spec.commonmark.org/0.30/#example-150 + +
+*foo* +| <- meta.disable-markdown - markup.italic +|^^^^^ meta.disable-markdown - markup.italic + +## https://spec.commonmark.org/0.30/#example-152 + +
+| ^^^^^^^^^^^^^^^^ meta.disable-markdown + +*Markdown* +| ^^^^^^^ meta.paragraph markup.italic - meta.disable-markdown + +
+| ^^^ meta.disable-markdown meta.tag.block.any.html + +## https://spec.commonmark.org/0.30/#example-153 + +
+|^^^^^^^^^^^^^ meta.disable-markdown meta.tag.block +
+|^^^^^ meta.disable-markdown meta.tag.block + +## https://spec.commonmark.org/0.30/#example-154 + +
+|^^^^^^ meta.disable-markdown meta.tag.block +
+|^^^^^ meta.disable-markdown meta.tag.block + +## https://spec.commonmark.org/0.30/#example-155 + +
+*foo* +| <- meta.disable-markdown - markup.italic + +
+*foo* + +*bar* +| <- meta.paragraph.markdown markup.italic.markdown punctuation.definition.italic.begin.markdown + +## https://spec.commonmark.org/0.30/#example-159 + + +| ^^^^^ meta.disable-markdown - markup.italic + +## https://spec.commonmark.org/0.30/#example-161 + +
+``` c +int x = 33; +``` +|^^^ meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-162 + + +*bar* +| <- meta.disable-markdown - markup.italic - punctuation +|^^^^^ meta.disable-markdown - markup.italic + + +## https://spec.commonmark.org/0.30/#example-163 + + +*bar* +| <- meta.disable-markdown - markup.italic - punctuation +|^^^^^ meta.disable-markdown - markup.italic + +| ^^^^^^^ meta.disable-markdown meta.tag.other.html entity.name.tag.other.html + +## https://spec.commonmark.org/0.30/#example-164 + + +*bar* +| <- meta.disable-markdown - markup.italic - punctuation +|^^^^^ meta.disable-markdown - markup.italic + +| <- meta.disable-markdown meta.tag punctuation.definition.tag +|^^^ meta.disable-markdown meta.tag +| ^ meta.disable-markdown - meta.tag + +## https://spec.commonmark.org/0.30/#example-165 + + +*bar* +| <- meta.disable-markdown - markup.italic - punctuation +|^^^^^ meta.disable-markdown - markup.italic + +## https://spec.commonmark.org/0.30/#example-166 + + +*foo* +| <- meta.disable-markdown - markup.italic - punctuation +|^^^^^ meta.disable-markdown - markup.italic + +| <- meta.disable-markdown meta.tag punctuation.definition.tag +|^^^^^ meta.disable-markdown meta.tag +| ^ meta.disable-markdown - meta.tag + +## https://spec.commonmark.org/0.30/#example-167 + + +| <- meta.disable-markdown meta.tag punctuation.definition.tag +|^^^^ meta.disable-markdown meta.tag +| ^ meta.disable-markdown - meta.tag + +*foo* +| <- meta.paragraph.markdown markup.italic.markdown punctuation.definition.italic.begin.markdown +|^^^ meta.paragraph.markdown markup.italic.markdown - punctuation +| ^ meta.paragraph.markdown markup.italic.markdown punctuation.definition.italic.end.markdown + + +| <- meta.disable-markdown meta.tag punctuation.definition.tag +|^^^^^ meta.disable-markdown meta.tag +| ^ meta.disable-markdown - meta.tag + +## https://spec.commonmark.org/0.30/#example-168 + +*foo* +|^^^^^^^^^^^^^^^ meta.paragraph - meta.disable-markdown +|^^^^ meta.tag.inline +| ^^^^^ markup.italic +| ^^^^^^ meta.tag.inline + +## https://spec.commonmark.org/0.30/#example-169 + +

+| ^^ meta.disable-markdown meta.tag.block.any.html entity.name.tag.block.any.html
+import Text.HTML.TagSoup
+
+main :: IO ()
+| ^^^^^^^^^^^^ meta.disable-markdown
+main = print $ parseTags tags
+
+| ^^^^^^^^^^^ meta.disable-markdown +| ^^^ meta.tag.block.any.html entity.name.tag.block.any.html +okay +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-170 + + +| ^^^^^^ meta.disable-markdown meta.tag.script.end.html entity.name.tag.script.html +okay +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-171 + + +| ^^^^^ meta.disable-markdown meta.tag.style.end.html entity.name.tag.style.html +okay +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-172 + + +okay +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-174 + +>
+> foo + +bar +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-175 + +-
+- foo +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-176 + + +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown +*foo* +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-177 + +*bar* +| ^^^^^^^^^^ comment.block.html +| ^^^^^ meta.disable-markdown +*baz* +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-178 + +1. *bar* +| ^^^^^^^^^^^^^^^^ meta.disable-markdown +okay +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-179 + + +| ^^^^^^^^ meta.disable-markdown comment.block.html +okay +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-180 + +'; + +?> +|^^ meta.disable-markdown +okay +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-181 + + +| ^^^^^^^ meta.disable-markdown meta.tag.sgml.doctype.html +okay +| <- - meta.disable-markdown + + +| ^^^^^^^^^^^^^ meta.disable-markdown +okay +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-182 + + +|^^ meta.disable-markdown meta.tag.sgml +okay +| <- - meta.disable-markdown + +## https://spec.commonmark.org/0.30/#example-183 + + +| ^^^^^^^^^^^^ meta.disable-markdown comment.block.html + + +|^^^^^^^^^^^^^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-184 + +
+ +
+|^^^^^^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-188 + +
+ +*Emphasized* text. +|^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown +| <- markup.italic.markdown punctuation.definition.italic.begin.markdown +|^^^^^^^^^^^ markup.italic.markdown + +
+| <- meta.disable-markdown meta.tag.block +|^^^^^ meta.disable-markdown meta.tag.block + +## https://spec.commonmark.org/0.30/#example-189 + +
+*Emphasized* text. +| <- meta.disable-markdown - markup.italic +|^^^^^^^^^^^^^^^^^^ meta.disable-markdown - markup.italic +
+| <- meta.disable-markdown meta.tag.block +|^^^^^ meta.disable-markdown meta.tag.block + +## https://spec.commonmark.org/0.30/#example-190 + + +| <- meta.disable-markdown meta.tag +|^^^^^^ meta.disable-markdown meta.tag + + +| <- meta.disable-markdown meta.tag +|^^^ meta.disable-markdown meta.tag + + +| <- meta.disable-markdown meta.tag +|^^^^ meta.disable-markdown meta.tag + + +| <- meta.disable-markdown meta.tag +|^^^^ meta.disable-markdown meta.tag + +
+Hi +
+| <- meta.disable-markdown meta.tag +|^^^^^^^ meta.disable-markdown meta.tag + +## https://spec.commonmark.org/0.30/#example-191 + + +| <- meta.disable-markdown meta.tag +|^^^^^^ meta.disable-markdown meta.tag + + +| <- meta.disable-markdown +|^^^^^^^ meta.disable-markdown + + +| <- markup.raw.block.markdown +|^^^^^^^^^ markup.raw.block.markdown + + +| <- meta.disable-markdown +|^^^^^^^ meta.disable-markdown + +
+ Hi +
+| <- meta.disable-markdown meta.tag +|^^^^^^^ meta.disable-markdown meta.tag + +## https://custom-tests/html-blocks + +
this is HTML until there are two blank lines
+| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown +disabled markdown +| <- meta.disable-markdown + +non-disabled markdown +| <- - meta.disable-markdown + +
this is HTML until there are two blank lines +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown +still HTML +| ^^^^ meta.tag.inline.any.html entity.name.tag.inline.any.html +
+| ^^^^ meta.disable-markdown + +non-disabled markdown +| <- - meta.disable-markdown -| <- markup.raw.code-fence.shell-script.markdown-gfm source.shell.bash -``` -| <- meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -|^^ meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +
nested tags don't count 
test
+| ^^^^^^ meta.disable-markdown meta.tag.block.any.html +non-disabled markdown +| <- - meta.disable-markdown -```sql -|^^^^^ meta.code-fence.definition.begin.sql -| ^^^ constant.other.language-name -SELECT TOP 10 * -|^^^^^^^^^^^^^^^ markup.raw.code-fence.sql source.sql -FROM TableName -``` -| <- meta.code-fence.definition.end.sql.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -|^^ meta.code-fence.definition.end.sql.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +
nested tags don't count
test +| ^^^^^ meta.disable-markdown +
+| ^^^ meta.disable-markdown entity.name.tag.block.any.html -```ts -declare type foo = 'bar' -| <- markup.raw.code-fence.typescript.markdown-gfm source.ts -``` -| <- meta.code-fence.definition.end.typescript.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -|^^ meta.code-fence.definition.end.typescript.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +non-disabled markdown +| <- - meta.disable-markdown -```tsx +
two blank lines needed
to stop disabled markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown +disabled markdown +| <- meta.disable-markdown -| <- markup.raw.code-fence.tsx.markdown-gfm -``` -| <- meta.code-fence.definition.end.tsx.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -|^^ meta.code-fence.definition.end.tsx.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +non-disabled markdown +| <- - meta.disable-markdown -```xml -|^^^^^ meta.code-fence.definition.begin.xml -| ^^^ constant.other.language-name - -|^^^^^^^^^^^^^^^^^^^^^^ markup.raw.code-fence.xml -| ^^^^^^^ meta.tag.preprocessor.xml entity.other.attribute-name.localname.xml - - - -``` -| <- meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -|^^ meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +
another
disable test +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown +| ^^^^^^ meta.tag.inline.any.html +disabled markdown +| <- meta.disable-markdown -```R%&?! weired language name -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -| ^^^^^ constant.other.language-name.markdown -| ^^^^^^^^^^^^^^^^^^^^^ - constant -``` +non-disabled markdown +| <- - meta.disable-markdown -```{key: value} -|^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -| ^^^^^^^^^^^^ - constant -``` +*a* +| ^ markup.italic +

*a*

+| ^^^^^^^^^ meta.disable-markdown - markup.italic +*a* +| ^^ meta.disable-markdown -``` {key: value} -|^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -| ^^^^^^^^^^^^ - constant -``` +non-disabled markdown +| <- - meta.disable-markdown # TEST: CODE SPANS ############################################################ @@ -3004,9 +3411,6 @@ because it doesn't begin with the number one: | ^^ markup.list.numbered.bullet.markdown | ^^^^^^^^^^^^^^ markup.list.numbered.markdown - -| ^^^^^^^^^^^^^^^^^^^^^ comment.block.html - *italic text HTML element end of italic text* | <- punctuation.definition.italic | ^ punctuation.definition.italic @@ -4149,203 +4553,6 @@ Normal paragraph Test | <- meta.paragraph - markup.list -http://spec.commonmark.org/0.28/#example-116 - -
-
-**Hello**,
-| ^^^^^^^^^ meta.disable-markdown
-
-_world_.
-| ^^^^ markup.italic - meta.disable-markdown
-
-
- -http://spec.commonmark.org/0.28/#example-120 - -
-| ^^^^^^^^^^^^^^^^ meta.disable-markdown - -*Markdown* -| ^^^^^^^ meta.paragraph markup.italic - meta.disable-markdown - -
-| ^^^ meta.disable-markdown meta.tag.block.any.html - -http://spec.commonmark.org/0.28/#example-127 - - -| ^^^^^ meta.disable-markdown - markup.italic - -http://spec.commonmark.org/0.28/#example-129 - -
-``` c -int x = 33; -``` -| ^^ meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-130 - - -*bar* -|^^^^^ meta.disable-markdown - - -http://spec.commonmark.org/0.28/#example-131 - - -*bar* -|^^^^^ meta.disable-markdown - -| ^^^^^^^ meta.disable-markdown meta.tag.other.html entity.name.tag.other.html - -http://spec.commonmark.org/0.28/#example-135 - - -| ^^ meta.disable-markdown meta.tag.inline.any.html entity.name.tag.inline.any.html - -*foo* -| ^^ meta.paragraph markup.italic - - -| ^^^ meta.disable-markdown meta.tag.inline.any.html entity.name.tag.inline.any.html - - -*foo* -|^^^^^ meta.disable-markdown - - -http://spec.commonmark.org/0.28/#example-136 - -*foo* -| ^^ meta.tag.inline.any.html entity.name.tag.inline.any.html -| ^^^^^ markup.italic -| ^^^ meta.tag.inline.any.html entity.name.tag.inline.any.html -|^^^^^^^^^^^^^^^ meta.paragraph - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-137 - -

-| ^^ meta.disable-markdown meta.tag.block.any.html entity.name.tag.block.any.html
-import Text.HTML.TagSoup
-
-main :: IO ()
-| ^^^^^^^^^^^^ meta.disable-markdown
-main = print $ parseTags tags
-
-| ^^^^^^^^^^^ meta.disable-markdown -| ^^^ meta.tag.block.any.html entity.name.tag.block.any.html -okay -| <- - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-138 - - -| ^^^^^^ meta.disable-markdown meta.tag.script.end.html entity.name.tag.script.html -okay -| <- - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-139 - - -| ^^^^^ meta.disable-markdown meta.tag.style.end.html entity.name.tag.style.html -okay -| <- - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-143 - - -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -*foo* -| <- - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-144 - -*bar* -| ^^^^^^^^^^ comment.block.html -| ^^^^^ meta.disable-markdown -*baz* -| <- - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-145 - -1. *bar* -| ^^^^^^^^^^^^^^^^ meta.disable-markdown -okay -| <- - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-146 - - -| ^^^^^^^^ meta.disable-markdown comment.block.html -okay -| <- - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-147 - -'; - -?> -|^^ meta.disable-markdown -okay -| <- - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-148 - - -| ^^^^^^^ meta.disable-markdown meta.tag.sgml.doctype.html -okay -| <- - meta.disable-markdown - - -| ^^^^^^^^^^^^^ meta.disable-markdown -okay -| <- - meta.disable-markdown - -http://spec.commonmark.org/0.28/#example-149 - - -|^ meta.disable-markdown meta.tag.sgml -okay -| <- - meta.disable-markdown - 1. Test ```python From bcdc1dbf70e25db2623027890f7d8e97ffa3efc6 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 17:37:22 +0100 Subject: [PATCH 17/63] Syntax: Reorganize link reference definition tests This commit moves all link ref defs into a dedicated section. --- tests/syntax_test_markdown.md | 258 ++++++++++++++++++---------------- 1 file changed, 134 insertions(+), 124 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 03d4da6f..09c7f21f 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1418,13 +1418,6 @@ Paragraph break. |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote | ^^^^^^^^^ markup.italic -[1]: https://google.com -| <- meta.link.reference.def.markdown -|^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -|^ entity.name.reference.link -| ^ punctuation.separator.key-value -| ^^^^^^^^^^^^^^^^^^ markup.underline.link - # TEST: BLOCK QUOTES ########################################################## @@ -2735,6 +2728,140 @@ non-disabled markdown | <- - meta.disable-markdown +# TEST: LINK REFERENCE DEFINITIONS ############################################ + +## https://spec.commonmark.org/0.30/#example-192 + +[foo]: /url "title" +|^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +| ^ punctuation.separator.key-value +| ^^^^ markup.underline.link +| ^^^^^^^ string.quoted.double + +## https://spec.commonmark.org/0.30/#example-194 + + [Foo*bar\]]:my_(url) 'title (with parens)' +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +|^ punctuation.definition.reference.begin.markdown +| ^^^^^^^^^ entity.name.reference.link.markdown - punctuation +| ^ punctuation.definition.reference.end.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^^^^ markup.underline.link +| ^ - markup - string +| ^^^^^^^^^^^^^^^^^^^^^ string.quoted.single + +## https://spec.commonmark.org/0.30/#example-200 + +[foo]: <> +|^^^^^^^^ meta.link.reference.def.markdown +| ^ punctuation.separator.key-value +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end + +[foo]: "test" +|^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +| ^ - meta.link +| ^ punctuation.definition.link.begin +| ^^^ markup.underline.link +| ^ punctuation.definition.link.end +| ^^^^^^ string.quoted.double +| ^ - invalid.illegal.expected-eol + +[foo]: > "test" +|^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +| ^ - meta.link +| ^ punctuation.definition.link.begin +| ^^^ markup.underline.link +| ^ punctuation.definition.link.end +| ^^^^^^^^ invalid.illegal.expected-eol +| ^ - invalid.illegal.expected-eol + +[1]: https://google.com +| <- meta.link.reference.def.markdown +|^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +|^ entity.name.reference.link +| ^ punctuation.separator.key-value +| ^^^^^^^^^^^^^^^^^^ markup.underline.link + + +[2]: https://github.com/sublimehq/Packages "Packages Repo" +| <- meta.link.reference.def.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +|^ entity.name.reference.link +| ^ punctuation.separator.key-value +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^^^^^^^^^^^^^^^ string.quoted.double +| ^ punctuation.definition.string.begin +| ^ punctuation.definition.string.end + +[3]: https://github.com/sublimehq/Packages/issues/ 'Issues on Packages Repo' +| <- meta.link.reference.def.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +|^ entity.name.reference.link +| ^ punctuation.separator.key-value +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.single +| ^ punctuation.definition.string.begin +| ^ punctuation.definition.string.end + +[img-example]: http://www.sublimetext.com/anim/rename2_packed.png +|^^^^^^^^^^^ meta.link.reference.def.markdown entity.name.reference.link +| ^ punctuation.separator.key-value +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ - meta.link - markup + +[//]: # (This is a comment without a line-break.) +| ^ meta.link.reference.def.markdown markup.underline.link +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.other +| ^ - meta.link + +[//]: # (This is a comment with a +| ^ meta.link.reference.def.markdown markup.underline.link +| ^ punctuation.definition.string.begin + line-break.) +| ^ punctuation.definition.string.end +| ^ - meta.link + +[//]: # (testing)blah +|^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +| ^ punctuation.definition.string.begin +| ^ punctuation.definition.string.end +| ^^^^ invalid.illegal.expected-eol +| ^ - meta.link - invalid + +[//]: # (testing +blah +| <- meta.link.reference.def.markdown string.quoted.other + +| <- invalid.illegal.non-terminated.link-title +text +| <- meta.paragraph - meta.link.reference.def.markdown + +1. list [001]blah +| ^^^^^ meta.link.reference +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^^^^^ - meta.link + + [001]: https://en.wikipedia.org/wiki/Root-mean-square_deviation "Wikipedia - RMSE" +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.link.reference.def.markdown +1. another list item +| <- markup.list.numbered.bullet.markdown + + [^1]: And that's the footnote. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.footnote.markdown-extra +|^ punctuation.definition.reference.begin.markdown +| ^^ entity.name.reference.link.markdown +| ^ punctuation.definition.reference.end.markdown +| ^ punctuation.separator.key-value.markdown + +[^1]: + And that's the footnote. + + That's the *second* paragraph. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.footnote.markdown-extra - markup.raw +| ^^^^^^^^ markup.italic + # TEST: CODE SPANS ############################################################ ```testing``123``` @@ -3174,26 +3301,6 @@ a.b-c_d@a.b. |^^^^^^^^^^^^^ - meta.link - markup.underline.link -[2]: https://github.com/sublimehq/Packages "Packages Repo" -| <- meta.link.reference.def.markdown -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -|^ entity.name.reference.link -| ^ punctuation.separator.key-value -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^^^^^^^^^^^^^^^ string.quoted.double -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end - -[3]: https://github.com/sublimehq/Packages/issues/ 'Issues on Packages Repo' -| <- meta.link.reference.def.markdown -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -|^ entity.name.reference.link -| ^ punctuation.separator.key-value -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.single -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end - Paragraph followed immediately by a list, no blank line in between - list item 1 | <- markup.list.unnumbered punctuation.definition.list_item @@ -4237,57 +4344,6 @@ _foo [**bar**](/url)_ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link | ^ punctuation.definition.metadata.end -[img-example]: http://www.sublimetext.com/anim/rename2_packed.png -|^^^^^^^^^^^ meta.link.reference.def.markdown entity.name.reference.link -| ^ punctuation.separator.key-value -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ - meta.link - markup - -[//]: # (This is a comment without a line-break.) -| ^ meta.link.reference.def.markdown markup.underline.link -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.other -| ^ - meta.link - -[//]: # (This is a comment with a -| ^ meta.link.reference.def.markdown markup.underline.link -| ^ punctuation.definition.string.begin - line-break.) -| ^ punctuation.definition.string.end -| ^ - meta.link - -[//]: # (testing)blah -|^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^^^^ invalid.illegal.expected-eol -| ^ - meta.link - invalid - -[//]: # (testing -blah -| <- meta.link.reference.def.markdown string.quoted.other - -| <- invalid.illegal.non-terminated.link-title -text -| <- meta.paragraph - meta.link.reference.def.markdown - -[foo]: "test" -|^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -| ^ - meta.link -| ^ punctuation.definition.link.begin -| ^^^ markup.underline.link -| ^ punctuation.definition.link.end -| ^^^^^^ string.quoted.double -| ^ - invalid.illegal.expected-eol - -[foo]: > "test" -|^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -| ^ - meta.link -| ^ punctuation.definition.link.begin -| ^^^ markup.underline.link -| ^ punctuation.definition.link.end -| ^^^^^^^^ invalid.illegal.expected-eol -| ^ - invalid.illegal.expected-eol - https://michelf.ca/projects/php-markdown/extra/#footnotes That's some text with a footnote.[^1] | ^^^^ meta.paragraph meta.link.reference.footnote.markdown-extra @@ -4295,20 +4351,6 @@ That's some text with a footnote.[^1] | ^^ meta.link.reference.literal.footnote-id | ^ punctuation.definition.link.end - [^1]: And that's the footnote. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.footnote.markdown-extra -|^ punctuation.definition.reference.begin.markdown -| ^^ entity.name.reference.link.markdown -| ^ punctuation.definition.reference.end.markdown -| ^ punctuation.separator.key-value.markdown - -[^1]: - And that's the footnote. - - That's the *second* paragraph. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.footnote.markdown-extra - markup.raw -| ^^^^^^^^ markup.italic - - a - b - c @@ -4571,22 +4613,6 @@ link with a single underscore inside the text : [@_test](http://example.com) | ^^^^^^ meta.paragraph meta.link.inline.description - punctuation.definition | ^ meta.paragraph meta.link.inline punctuation.definition.link.end -1. list [001]blah -| ^^^^^ meta.link.reference -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^^^^^ - meta.link - - [001]: https://en.wikipedia.org/wiki/Root-mean-square_deviation "Wikipedia - RMSE" -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.link.reference.def.markdown -1. another list item - -[foo]: /url "title" -|^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -| ^ punctuation.separator.key-value -| ^^^^ markup.underline.link -| ^^^^^^^ string.quoted.double - [foo] |<- meta.link.reference punctuation.definition.link.begin |^^^ meta.paragraph meta.link.reference @@ -4601,22 +4627,6 @@ This is literal [Foo*bar\]] but [ref][Foo*bar\]] | ^^^^^ meta.link.reference.description.markdown | ^^^^^^^^^^^ meta.link.reference.metadata.markdown - [Foo*bar\]]:my_(url) 'title (with parens)' -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -|^ punctuation.definition.reference.begin.markdown -| ^^^^^^^^^ entity.name.reference.link.markdown - punctuation -| ^ punctuation.definition.reference.end.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^^^^ markup.underline.link -| ^ - markup - string -| ^^^^^^^^^^^^^^^^^^^^^ string.quoted.single - - [foo]: <> -|^^^^^^^^^ meta.link.reference.def.markdown -| ^ punctuation.separator.key-value -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end - # TEST: CRITIC MARKUP ######################################################### This is an {++additional++} word in {++**bold**++}. From 7409a7548256d4110fde80d649c10cbecec62eb8 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 18:52:15 +0100 Subject: [PATCH 18/63] Syntax: Fix CommonMark compatibility of reference definitions This commit... 1. adds most official CommonMark tests 2. fixes some compatibility issues with definitions, which span several lines. Note: This change has some negative side effects with regards to `Goto Symbol` function, because ST merges several lines to one symbol. This can only be fixed with ST4's branching. --- messages/3.1.1.md | 1 + syntaxes/Markdown.sublime-syntax | 28 ++-- tests/syntax_test_markdown.md | 262 +++++++++++++++++++++++++------ 3 files changed, 233 insertions(+), 58 deletions(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index d4047899..2339cae2 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -10,6 +10,7 @@ feedback you can use [GitHub issues][issues]. * fix CommonMark compatibility of html entities * fix CommonMark compatibility of fenced code blocks * fix CommonMark compatibility of indented code blocks (mixed tabs/spaces) +* fix CommonMark compatibility of reference definitions * fix CommonMark compatibility of thematic breaks * update strikethough markup to use 2 tildes (fixes #637) diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 16f3efcb..c2b3f61d 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -2095,41 +2095,42 @@ contexts: 4: punctuation.separator.key-value.markdown push: - link-def-end - - link-title + - link-def-title - link-def-url link-def-end: - meta_scope: meta.link.reference.def.markdown - - include: eol-pop + - match: ^ + pop: true - match: \s*\S+ scope: invalid.illegal.expected-eol.markdown + link-def-title: + - include: link-title-begin + - include: paragraph-end + - include: else-pop + link-def-url: - match: < scope: punctuation.definition.link.begin.markdown set: link-def-url-angled - match: (?=\S) set: link-def-url-unquoted - - include: eol-pop + - include: paragraph-end link-def-url-angled: - meta_content_scope: markup.underline.link.markdown - - match: \> - scope: punctuation.definition.link.end.markdown - pop: true - - include: link-def-url-common + - include: link-url-angled link-def-url-unquoted: - meta_scope: markup.underline.link.markdown - - include: link-def-url-common - - link-def-url-common: # URLs are terminated by whitespace or newline in reference definitions # Note: \s includes \n - match: (?=\s) pop: true - include: link-url-common + ###[ LEAF BLOCKS: TABLES ]#################################################### tables: @@ -2753,6 +2754,11 @@ contexts: - include: images link-title: + - include: link-title-begin + - include: eol-pop + - include: else-pop + + link-title-begin: - match: \' scope: punctuation.definition.string.begin.markdown set: link-title-single-quoted-content @@ -2762,8 +2768,6 @@ contexts: - match: \( scope: punctuation.definition.string.begin.markdown set: link-title-other-quoted-content - - match: $|(?=\S) - pop: true link-title-double-quoted-content: - meta_scope: meta.string.title.markdown string.quoted.double.markdown diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 09c7f21f..b550777b 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -2738,6 +2738,14 @@ non-disabled markdown | ^^^^ markup.underline.link | ^^^^^^^ string.quoted.double +## https://spec.commonmark.org/0.30/#example-193 + + [foo]: + /url + 'the title' +|^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +| ^^^^^^^^^^^ string.quoted.single + ## https://spec.commonmark.org/0.30/#example-194 [Foo*bar\]]:my_(url) 'title (with parens)' @@ -2750,6 +2758,60 @@ non-disabled markdown | ^ - markup - string | ^^^^^^^^^^^^^^^^^^^^^ string.quoted.single +## https://spec.commonmark.org/0.30/#example-195 + +[Foo bar]: + +| <- meta.link.reference.def.markdown punctuation.definition.link.begin.markdown +|^^^^^^ meta.link.reference.def.markdown markup.underline.link.markdown +| ^ meta.link.reference.def.markdown punctuation.definition.link.end.markdown + +[Foo bar]: + +'title' +| <- meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown +|^^^^^^ meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown + +## https://spec.commonmark.org/0.30/#example-196 + +[foo]: /url ' +| ^ meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown punctuation.definition.string.begin.markdown +title +| <- meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown +|^^^^^ meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown +line1 +| <- meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown +|^^^^^ meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown +line2 +| <- meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown +|^^^^^ meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown +' +| <- meta.link.reference.def.markdown meta.string.title.markdown string.quoted.single.markdown punctuation.definition.string.end.markdown + +## https://spec.commonmark.org/0.30/#example-197 + +[foo]: /url 'title + +with blank line' +| <- meta.paragraph.markdown - meta.link +|^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.link + +## https://spec.commonmark.org/0.30/#example-198 + +[foo]: +/url +| <- meta.link.reference.def.markdown markup.underline.link.markdown punctuation.separator.path.markdown +|^^^ meta.link.reference.def.markdown markup.underline.link.markdown + +## https://spec.commonmark.org/0.30/#example-199 + +[foo]: +| <- meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown +|^^^ meta.link.reference.def.markdown entity.name.reference.link.markdown +| ^ meta.link.reference.def.markdown punctuation.definition.reference.end.markdown +| ^ meta.link.reference.def.markdown punctuation.separator.key-value.markdown +| ^ meta.link.reference.def.markdown - punctuation + ## https://spec.commonmark.org/0.30/#example-200 [foo]: <> @@ -2758,76 +2820,182 @@ non-disabled markdown | ^ punctuation.definition.link.begin | ^ punctuation.definition.link.end -[foo]: "test" -|^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -| ^ - meta.link +## https://spec.commonmark.org/0.30/#example-201 + +[foo]: (baz) +| <- meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown +|^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +|^^^ entity.name.reference.link.markdown +| ^ punctuation.definition.reference.end.markdown +| ^ punctuation.separator.key-value.markdown +| ^ punctuation.definition.link.begin.markdown +| ^^^ markup.underline.link.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^ meta.string.title.markdown string.quoted.other.markdown +| ^ punctuation.definition.string.begin.markdown +| ^ punctuation.definition.string.end.markdown + +## https://spec.commonmark.org/0.30/#example-202 + +[foo]: /url\bar\*baz "foo\"bar\baz" +| <- meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +|^^^ entity.name.reference.link.markdown +| ^ punctuation.definition.reference.end.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^^^^^^^^^ markup.underline.link.markdown +| ^ punctuation.separator.path.markdown +| ^^ - constant.character.escape +| ^^ constant.character.escape.markdown +| ^^^^^^^^^^^^^^ meta.string.title.markdown string.quoted.double.markdown +| ^ punctuation.definition.string.begin.markdown +| ^^ constant.character.escape.markdown +| ^^ - constant.character.escape +| ^ punctuation.definition.string.end.markdown + +## https://spec.commonmark.org/0.30/#example-203 + +[foo]: url +| <- meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown +|^^^^^^^^^ meta.link.reference.def.markdown +|^^^ entity.name.reference.link.markdown +| ^ punctuation.definition.reference.end.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^ markup.underline.link.markdown + +## https://spec.commonmark.org/0.30/#example-204 + +[foo]: first +[foo]: second +| <- meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown +|^^^^^^^^^^^^ meta.link.reference.def.markdown +|^^^ entity.name.reference.link.markdown +| ^ punctuation.definition.reference.end.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^^ markup.underline.link.markdown + + +## https://spec.commonmark.org/0.30/#example-205 + +[FOO]: /url +| <- meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown +|^^^^^^^^^^ meta.link.reference.def.markdown +|^^^ entity.name.reference.link.markdown +| ^ punctuation.definition.reference.end.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^ markup.underline.link.markdown + +## https://spec.commonmark.org/0.30/#example-206 + +[ΑΓΩ]: /φου +| <- meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown +|^^^^^^^^^^ meta.link.reference.def.markdown +|^^^ entity.name.reference.link.markdown +| ^ punctuation.definition.reference.end.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^ markup.underline.link.markdown + +## https://spec.commonmark.org/0.30/#example-208 + +[ +foo +]: /url +bar +| <- meta.paragraph.markdown - meta.link +|^^^ meta.paragraph.markdown - meta.link + +## https://spec.commonmark.org/0.30/#example-209 + +This is not a link reference definition, because there are characters other than spaces or tabs after the title: + +[foo]: /url "title" ok +|^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown +| ^^ invalid.illegal.expected-eol.markdown + +## https://spec.commonmark.org/0.30/#example-210 + +This is a link reference definition, but it has no title: + +[foo]: /url +"title" ok +|^^^^^^^^^^ meta.link.reference.def.markdown +| ^^ invalid.illegal.expected-eol.markdown + +[foo]: "baz" +|^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown | ^ punctuation.definition.link.begin | ^^^ markup.underline.link | ^ punctuation.definition.link.end -| ^^^^^^ string.quoted.double -| ^ - invalid.illegal.expected-eol +| ^^^^^ string.quoted.double +| ^ - invalid.illegal.expected-eol -[foo]: > "test" -|^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -| ^ - meta.link +[foo]: > "baz" +|^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown | ^ punctuation.definition.link.begin | ^^^ markup.underline.link | ^ punctuation.definition.link.end -| ^^^^^^^^ invalid.illegal.expected-eol -| ^ - invalid.illegal.expected-eol +| ^^^^^^^ invalid.illegal.expected-eol +| ^ - invalid.illegal.expected-eol -[1]: https://google.com -| <- meta.link.reference.def.markdown -|^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -|^ entity.name.reference.link -| ^ punctuation.separator.key-value -| ^^^^^^^^^^^^^^^^^^ markup.underline.link - - -[2]: https://github.com/sublimehq/Packages "Packages Repo" -| <- meta.link.reference.def.markdown -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -|^ entity.name.reference.link -| ^ punctuation.separator.key-value -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^^^^^^^^^^^^^^^ string.quoted.double -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end - -[3]: https://github.com/sublimehq/Packages/issues/ 'Issues on Packages Repo' -| <- meta.link.reference.def.markdown -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -|^ entity.name.reference.link -| ^ punctuation.separator.key-value -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.single -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end - -[img-example]: http://www.sublimetext.com/anim/rename2_packed.png -|^^^^^^^^^^^ meta.link.reference.def.markdown entity.name.reference.link -| ^ punctuation.separator.key-value -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ - meta.link - markup +## https://spec.commonmark.org/0.30/#example-211 + +This is not a link reference definition, because it is indented four spaces: + + [foo]: /url "title" +|^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block.markdown - meta.link + +## https://spec.commonmark.org/0.30/#example-212 + +This is not a link reference definition, because it occurs inside a code block: + +``` +[foo]: /url +| <- markup.raw.code-fence.markdown-gfm - meta.link +|^^^^^^^^^^^ markup.raw.code-fence.markdown-gfm - meta.link +``` + +## https://spec.commonmark.org/0.30/#example-213 + +A link reference definition cannot interrupt a paragraph. + +Foo +[bar]: /baz +| <- meta.paragraph.markdown meta.link.reference.description.markdown punctuation.definition.link.begin.markdown +|^^^^^^^^^^^ meta.paragraph.markdown +|^^^^ meta.link.reference.description.markdown +| ^^^^^^^ - punctuation - markup.underline + +## https://spec.commonmark.org/0.30/#example-214 + +### [Foo] +[foo]: /url +| <- meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown +|^^^^^^^^^^^ meta.link.reference.def.markdown + +### [Foo] +[foo]: /url +> bar +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^ markup.quote.markdown + +## https://custom-tests/link-reference-definitions [//]: # (This is a comment without a line-break.) | ^ meta.link.reference.def.markdown markup.underline.link | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.other -| ^ - meta.link [//]: # (This is a comment with a | ^ meta.link.reference.def.markdown markup.underline.link | ^ punctuation.definition.string.begin line-break.) | ^ punctuation.definition.string.end -| ^ - meta.link [//]: # (testing)blah |^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown | ^ punctuation.definition.string.begin | ^ punctuation.definition.string.end | ^^^^ invalid.illegal.expected-eol -| ^ - meta.link - invalid +| ^ - invalid [//]: # (testing blah @@ -2848,6 +3016,8 @@ text 1. another list item | <- markup.list.numbered.bullet.markdown +## https://custom-tests/footnote-reference-definitions + [^1]: And that's the footnote. |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.footnote.markdown-extra |^ punctuation.definition.reference.begin.markdown From 4f026fccda99b9c53d7d2f638037ced5e32af5b7 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 19:06:49 +0100 Subject: [PATCH 19/63] Syntax: Reorganize block quote tests --- tests/syntax_test_markdown.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index b550777b..96d80756 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1411,16 +1411,14 @@ Paragraph break. ``` |^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -Paragraph break. + +# TEST: BLOCK QUOTES ########################################################## > This is a block quote. It contains markup. > Including things like *italics* |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote | ^^^^^^^^^ markup.italic - -# TEST: BLOCK QUOTES ########################################################## - >= | <- punctuation.definition.blockquote.markdown From 440fa3dc32c2032bee11af5f3e81e32dbfc78de6 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 20:29:19 +0100 Subject: [PATCH 20/63] Syntax: Reorganize table tests This commit moves existing table related tests into a dedicated section. --- tests/syntax_test_markdown.md | 300 +++++++++++++++++----------------- 1 file changed, 152 insertions(+), 148 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 96d80756..d3ae32df 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -3030,6 +3030,158 @@ text |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.footnote.markdown-extra - markup.raw | ^^^^^^^^ markup.italic + +# TEST: TABLES ################################################################ + +| foo | bar | +|^^^^^^^^^^^^^ meta.table.header +| <- punctuation.separator.table-cell +| ^ punctuation.separator.table-cell +| ^ punctuation.separator.table-cell +| ^^^^ - punctuation.separator.table-cell + +| foo | bar | +| --- | --- | +| baz | bim Ctrl+C | +| <- meta.table punctuation.separator.table-cell +| ^^^^^ meta.tag.inline.any +| ^ punctuation.separator.table-cell + +| <- - meta.table + +| abc | defghi | +:-: | -----------: +|^^^^^^^^^^^^^^^^^ meta.table.header-separator +| <- punctuation.definition.table-cell-alignment +|^ punctuation.section.table-header +| ^ punctuation.separator.table-cell +| ^^^^^^^^^^^ punctuation.section.table-header +| ^ punctuation.definition.table-cell-alignment - punctuation.section.table-header +bar | baz +| ^ meta.table punctuation.separator.table-cell + +| f\|oo | +| <- meta.table punctuation.separator.table-cell +| ^^ meta.table constant.character.escape - punctuation.separator.table-cell +| ^ meta.table punctuation.separator.table-cell + +| f\|oo | +| ------ | +| b `|` az | +| ^^^ meta.table markup.raw.inline - meta.table.header-separator +| ^ meta.table punctuation.separator.table-cell +| b **|** im | +| <- meta.table punctuation.separator.table-cell +| ^^^^^ meta.table markup.bold - punctuation.separator.table-cell +| ^ meta.table punctuation.separator.table-cell + +| abc | def | +| --- | --- | +| bar | baz | +|^^^^^^^^^^^^^ meta.table +test +|^^^^ meta.table +> bar +| <- markup.quote punctuation.definition.blockquote - meta.table + +`|` this `|` example `|` is not a table `|` +| ^ punctuation.definition.raw.end - meta.table +| nor is this | because it is not at block level, it immediately follows a paragraph | +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - meta.table + +| First Header | Second Header | Third Header | +| :------------ | :-----------: | -------------------: | +| First row | Data | Very long data entry | +| Second row | **Cell** | *Cell* | +| Third row | Cell that spans across two columns || +| ^^^^^^^^^^^^^^ meta.table +| ^^ punctuation.separator.table-cell + + | table that doesn't start at column 0 | + | ---- | + | blah | +| ^^^^^^^^ meta.table +| ^ punctuation.separator.table-cell + +not a table | +| ^^^^^^^^^^^^^ - meta.table + + abc | def + --- | --- + --- | --- +| ^^^^ meta.table - meta.table.header + + a | b + - | - +|^^^^^^ meta.table.header-separator.markdown-gfm +|^ punctuation.section.table-header.markdown +| ^ punctuation.separator.table-cell.markdown +| ^ punctuation.section.table-header.markdown + - | - +|^^^^^^ meta.table.markdown-gfm + + a | b + -:| - +|^^^^^^ meta.table.header-separator.markdown-gfm +|^ punctuation.section.table-header.markdown +| ^ punctuation.definition.table-cell-alignment.markdown +| ^ punctuation.separator.table-cell.markdown +| ^ punctuation.section.table-header.markdown + - | - +|^^^^^^ meta.table.markdown-gfm + +| test | me | +|------|----| +|^^^^^^ punctuation.section.table-header +|*test | me | +|^^^^^^ - markup.bold +| ^ punctuation.separator.table-cell +| ^ punctuation.separator.table-cell +|`test | me | +|^ invalid.deprecated.unescaped-backticks +| ^ punctuation.separator.table-cell + +| table | followed by +paragraph +| <- meta.paragraph.markdown +|^^^^^^^^^ meta.paragraph.markdown + +| table | followed by +https://foo.bar/baz +| <- meta.paragraph.markdown meta.link.inet.markdown markup.underline.link.markdown-gfm +|^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inet.markdown markup.underline.link.markdown-gfm + +| table | followed by +# heading +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^ markup.heading.1.markdown + +| table | followed by +> quote +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^^^ markup.quote.markdown + +| table | followed by + quote +| <- markup.raw.block.markdown +|^^^^^^^^^ markup.raw.block.markdown + +| table | followed by +```fenced +| <- meta.code-fence.definition.begin.text.markdown-gfm +|^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +code block +``` +| <- meta.code-fence.definition.end.text.markdown-gfm +|^^ meta.code-fence.definition.end.text.markdown-gfm + +A line without bolded | +| ^ - punctuation.separator.table-cell + +A line with bolded **|** +| ^ - punctuation.separator.table-cell + + # TEST: CODE SPANS ############################################################ ```testing``123``` @@ -4552,154 +4704,6 @@ That's some text with a footnote.[^1] abc | <- meta.paragraph - markup.list -| foo | bar | -|^^^^^^^^^^^^^ meta.table.header -| <- punctuation.separator.table-cell -| ^ punctuation.separator.table-cell -| ^ punctuation.separator.table-cell -| ^^^^ - punctuation.separator.table-cell - -| foo | bar | -| --- | --- | -| baz | bim Ctrl+C | -| <- meta.table punctuation.separator.table-cell -| ^^^^^ meta.tag.inline.any -| ^ punctuation.separator.table-cell - -| <- - meta.table - -| abc | defghi | -:-: | -----------: -|^^^^^^^^^^^^^^^^^ meta.table.header-separator -| <- punctuation.definition.table-cell-alignment -|^ punctuation.section.table-header -| ^ punctuation.separator.table-cell -| ^^^^^^^^^^^ punctuation.section.table-header -| ^ punctuation.definition.table-cell-alignment - punctuation.section.table-header -bar | baz -| ^ meta.table punctuation.separator.table-cell - -| f\|oo | -| <- meta.table punctuation.separator.table-cell -| ^^ meta.table constant.character.escape - punctuation.separator.table-cell -| ^ meta.table punctuation.separator.table-cell - -| f\|oo | -| ------ | -| b `|` az | -| ^^^ meta.table markup.raw.inline - meta.table.header-separator -| ^ meta.table punctuation.separator.table-cell -| b **|** im | -| <- meta.table punctuation.separator.table-cell -| ^^^^^ meta.table markup.bold - punctuation.separator.table-cell -| ^ meta.table punctuation.separator.table-cell - -| abc | def | -| --- | --- | -| bar | baz | -|^^^^^^^^^^^^^ meta.table -test -|^^^^ meta.table -> bar -| <- markup.quote punctuation.definition.blockquote - meta.table - -`|` this `|` example `|` is not a table `|` -| ^ punctuation.definition.raw.end - meta.table -| nor is this | because it is not at block level, it immediately follows a paragraph | -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - meta.table - -| First Header | Second Header | Third Header | -| :------------ | :-----------: | -------------------: | -| First row | Data | Very long data entry | -| Second row | **Cell** | *Cell* | -| Third row | Cell that spans across two columns || -| ^^^^^^^^^^^^^^ meta.table -| ^^ punctuation.separator.table-cell - - | table that doesn't start at column 0 | - | ---- | - | blah | -| ^^^^^^^^ meta.table -| ^ punctuation.separator.table-cell - -not a table | -| ^^^^^^^^^^^^^ - meta.table - - abc | def - --- | --- - --- | --- -| ^^^^ meta.table - meta.table.header - - a | b - - | - -|^^^^^^ meta.table.header-separator.markdown-gfm -|^ punctuation.section.table-header.markdown -| ^ punctuation.separator.table-cell.markdown -| ^ punctuation.section.table-header.markdown - - | - -|^^^^^^ meta.table.markdown-gfm - - a | b - -:| - -|^^^^^^ meta.table.header-separator.markdown-gfm -|^ punctuation.section.table-header.markdown -| ^ punctuation.definition.table-cell-alignment.markdown -| ^ punctuation.separator.table-cell.markdown -| ^ punctuation.section.table-header.markdown - - | - -|^^^^^^ meta.table.markdown-gfm - -| test | me | -|------|----| -|^^^^^^ punctuation.section.table-header -|*test | me | -|^^^^^^ - markup.bold -| ^ punctuation.separator.table-cell -| ^ punctuation.separator.table-cell -|`test | me | -|^ invalid.deprecated.unescaped-backticks -| ^ punctuation.separator.table-cell - -| table | followed by -paragraph -| <- meta.paragraph.markdown -|^^^^^^^^^ meta.paragraph.markdown - -| table | followed by -https://foo.bar/baz -| <- meta.paragraph.markdown meta.link.inet.markdown markup.underline.link.markdown-gfm -|^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inet.markdown markup.underline.link.markdown-gfm - -| table | followed by -# heading -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^ markup.heading.1.markdown - -| table | followed by -> quote -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^^^^^^^ markup.quote.markdown - -| table | followed by - quote -| <- markup.raw.block.markdown -|^^^^^^^^^ markup.raw.block.markdown - -| table | followed by -```fenced -| <- meta.code-fence.definition.begin.text.markdown-gfm -|^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -code block -``` -| <- meta.code-fence.definition.end.text.markdown-gfm -|^^ meta.code-fence.definition.end.text.markdown-gfm - -A line without bolded | -| ^ - punctuation.separator.table-cell - -A line with bolded **|** -| ^ - punctuation.separator.table-cell - 1. test | ^^^^^ markup.list.numbered meta.paragraph.list - test From 5631da341836b0313826cf301accaca38f8d7200 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 19:14:24 +0100 Subject: [PATCH 21/63] Syntax: Reorganize link/image tests This commit moves existing syntaxes to a new location, which matches the specification's chapter. --- tests/syntax_test_markdown.md | 1036 +++++++++++++++++---------------- 1 file changed, 535 insertions(+), 501 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index d3ae32df..fc5f00d1 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1082,273 +1082,6 @@ Fenced codeblocks are no no setext heading Paragraph of text that should be scoped as meta.paragraph. |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph -A [link](https://example.com){ :_attr = value }, *italic text* and **bold**. -| ^^^^^^ meta.link.inline.description.markdown -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^^^^^^^^^^ meta.attribute-with-value.markdown -| ^^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^ string.unquoted.markdown -| ^ punctuation.definition.attributes.end.markdown -| ^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^ punctuation.definition.bold -| ^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold - -Here is a [](https://example.com). -| ^^ meta.link.inline -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata - -Here is a [](https://example.com){_attr="value"}. -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^^^ string.quoted.double.markdown -| ^ punctuation.definition.attributes.end.markdown - -Here is a [link](#with_(parens/inside)_urls). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [link](\(foo\)). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^ markup.underline.link.markdown -| ^^ constant.character.escape.markdown -| ^^ constant.character.escape.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [link](foo\)\:). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^ markup.underline.link.markdown -| ^^ constant.character.escape.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [link](). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^^^^ markup.underline.link.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [link](http://example.com?foo=3#frag). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.definition.metadata.end.markdown - -Not a [link] (url) due to space. -| ^^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link - -Here is a [reference link][name]. -| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^ meta.link.reference.metadata.markdown -| ^ punctuation.definition.link.begin.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a [reference link][name]{_attr='value' :att2}. -| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^ meta.link.reference.metadata.markdown -| ^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.attributes.markdown -| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown -| ^ - meta.attribute-with-value -| ^^^^^ meta.attribute-with-value.markdown -| ^ punctuation.definition.link.begin.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^^^ string.quoted.single.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.definition.attributes.end.markdown - -Here is a [blank reference link][]{}. -| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.literal.description.markdown -| ^^ meta.link.reference.literal.metadata.markdown -| ^^ meta.link.reference.literal.attributes.markdown -| ^ punctuation.definition.link.begin.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^ punctuation.definition.metadata.end.markdown -| ^ punctuation.definition.attributes.begin.markdown -| ^ punctuation.definition.attributes.end.markdown - -Here is a footnote[^1][link][] or long[^longnote][link][]. -| ^^^^ meta.link.reference.footnote.markdown-extra -| ^^^^^^ meta.link.reference.literal.description.markdown -| ^^ meta.link.reference.literal.metadata.markdown -| ^^^^^^^^^^^ meta.link.reference.footnote.markdown-extra -| ^^^^^^^^ meta.link.reference.literal - -Here is a footnote [^footnote](not_link_dest). -| ^^^^^^^^^^^ meta.paragraph.markdown meta.link.reference.footnote.markdown-extra -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^ meta.link.reference.literal.footnote-id.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.link - -Here is a ![](https://example.com/cat.gif). -| ^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a ![](https://example.com/cat.gif){_at"r=value :att2}. -| ^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^^^^^^^^^^^^^^^^^^ meta.image.inline.attributes.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ invalid.illegal.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^ string.unquoted.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.definition.attributes.end.markdown - -Here is a ![Image Alt Text](https://example.com/cat.gif). -| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a ![Image Alt Text]( https://example.com/cat.gif ). -| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^ - markup.underline -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^^ - markup.underline -| ^ punctuation.definition.metadata.end.markdown - -Here is a ![Image Alt Text]( - https://example.com/cat.gif ). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a ![Image Alt Text]( - https://example.com/cat.gif - "hello" ). -|^^^^^^^ meta.image.inline string.quoted.double -| ^^^^ meta.image.inline -| ^ punctuation.definition.metadata.end - -Here is a ![Image Alt Text]( - "hello" ). -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown -| ^^ meta.paragraph.markdown - meta.image -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^^^ string.quoted.double.markdown -| ^ punctuation.definition.string.begin.markdown -| ^ punctuation.definition.string.end.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a ![Image Alt Text]( - (hello) ). -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown -| ^^ meta.paragraph.markdown - meta.image -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^^^ string.quoted.other.markdown -| ^ punctuation.definition.string.begin.markdown -| ^ punctuation.definition.string.end.markdown -| ^ punctuation.definition.metadata.end.markdown - -Here is a ![Image Alt Text]( - https://example .com /cat.gif (hello) ). -|^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline -| ^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown markup.underline.link.image.markdown -| ^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.image - markup.underline - -Here is a ![Image Ref Alt][1]. -| ^^^^^^^^^^^^^^^^ meta.image.reference.description.markdown -| ^^^ meta.image.reference.metadata.markdown -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown - -now you can access the [The Ever Cool Site: Documentation about Sites]( - www.thecoolsite.com.ca/documentations/about/cool ) for more information about... -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline markup.underline.link -| ^ - invalid -| ^ meta.link.inline punctuation.definition.metadata.end - -now you can access the [The Ever Cool Site: Documentation about Sites]( - www.thecoolsite.com.ca /documentations/about/cool ) for more information about... -| ^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inline markup.underline.link -| ^ meta.paragraph meta.link.inline - markup.underline.link -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - meta.link.inline - -now you can access the [The Ever Cool Site: Documentation about Sites]( - www.thecoolsite.com.ca/documentations/about/cool - (title)) for more information about... -| ^^^^^^^^ meta.paragraph meta.link.inline -| ^ punctuation.definition.metadata.end -| ^^^^^^^ string.quoted.other.markdown 1. Ordered list item | ^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered @@ -3196,184 +2929,590 @@ A line with bolded **|** ``` | <- punctuation.definition.raw.end -``testing`123```` -| <- punctuation.definition.raw.begin -| ^ - punctuation -| ^^^^ - punctuation -more text`` -| ^^ punctuation.definition.raw.end +``testing`123```` +| <- punctuation.definition.raw.begin +| ^ - punctuation +| ^^^^ - punctuation +more text`` +| ^^ punctuation.definition.raw.end + +``text + +| <- invalid.illegal.non-terminated.raw +text +| <- - markup.raw + +## https://spec.commonmark.org/0.30/#example-327 + +`hi`lo` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown +| ^^ - markup.raw + +## https://spec.commonmark.org/0.30/#example-328 + +`foo` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^ meta.paragraph.markdown markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-329 + +`` foo ` bar `` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^^^^^^^^^ markup.raw.inline.markdown +|^ punctuation.definition.raw.begin.markdown +| ^ - punctuation +| ^^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-330 + +` `` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^ markup.raw.inline.markdown +| ^^ - punctuation +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-331 + +` `` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^ markup.raw.inline.markdown +| ^^ - punctuation +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-332 + +` a` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-333 + +` b ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-334 + +` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown +| ^ - markup + +` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown +| ^ - markup + +## https://spec.commonmark.org/0.30/#example-335 + +`` +foo +bar +baz +`` +| <- markup.raw.inline.markdown punctuation.definition.raw.end.markdown +|^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-336 + +`` +foo +`` +| <- markup.raw.inline.markdown punctuation.definition.raw.end.markdown +|^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-337 + +`foo bar + baz` +|^^^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-338 + +`foo\`bar` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^ markup.raw.inline.markdown +| ^^^ - markup.raw + +## https://spec.commonmark.org/0.30/#example-339 + +``foo`bar`` +| <- meta.paragraph.markdown markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^^^^ meta.paragraph.markdown markup.raw.inline.markdown +|^ punctuation.definition.raw.begin.markdown +| ^^^^^^^ - punctuation +| ^^ punctuation.definition.raw.end.markdown + +````bar```` baz +|^^^^^^^^^^ markup.raw.inline.markdown +| ^^^^^ - markup.raw + +## https://spec.commonmark.org/0.30/#example-340 + +`foo `` bar` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^^^^ markup.raw.inline.markdown - punctuation +| ^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-341 + +*foo`*` +| <- markup.italic.markdown punctuation.definition.italic.begin.markdown +| ^^^ markup.italic.markdown markup.raw.inline.markdown + +| <- invalid.illegal.non-terminated.bold-italic + +## https://spec.commonmark.org/0.30/#example-342 + +[not a `link](/foo`) +|^^^^^^^^^^^^^^^^^^^ - meta.link +| ^^^^^^^^^^^^ markup.raw.inline.markdown + +## https://spec.commonmark.org/0.30/#example-343 + +`` +|^^^^^^^^^^ markup.raw.inline.markdown +| ^^ - markup.raw + +| <- invalid.illegal.non-terminated.raw + +## https://spec.commonmark.org/0.30/#example-344 + +` +| ^^^^^^^^^ meta.tag.inline.a +| ^ punctuation.definition.raw.begin + +| <- invalid.illegal.non-terminated.raw + +## https://spec.commonmark.org/0.30/#example-345 + +`` +|^^^^^^^^^^^^^^^^^ markup.raw.inline +| ^ punctuation.definition.raw.begin + +| <- invalid.illegal.non-terminated.raw + +## https://spec.commonmark.org/0.30/#example-346 + +` +|^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.raw.begin + +| <- invalid.illegal.non-terminated.raw + + +# TEST: LINKS ################################################################# + +A [link](https://example.com){ :_attr = value }, *italic text* and **bold**. +| ^^^^^^ meta.link.inline.description.markdown +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^^^^^^^^^^ meta.attribute-with-value.markdown +| ^^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^ string.unquoted.markdown +| ^ punctuation.definition.attributes.end.markdown +| ^^^^^^^^^^^^^ markup.italic +| ^ punctuation.definition.italic +| ^ punctuation.definition.italic +| ^^ punctuation.definition.bold +| ^^^^^^^^ markup.bold +| ^^ punctuation.definition.bold + +Here is a [](https://example.com). +| ^^ meta.link.inline +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata -``text +Here is a [](https://example.com){_attr="value"}. +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^^^ string.quoted.double.markdown +| ^ punctuation.definition.attributes.end.markdown -| <- invalid.illegal.non-terminated.raw -text -| <- - markup.raw +Here is a [link](#with_(parens/inside)_urls). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-327 +Here is a [link](\(foo\)). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^ markup.underline.link.markdown +| ^^ constant.character.escape.markdown +| ^^ constant.character.escape.markdown +| ^ punctuation.definition.metadata.end.markdown -`hi`lo` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown -| ^^ - markup.raw +Here is a [link](foo\)\:). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^ markup.underline.link.markdown +| ^^ constant.character.escape.markdown +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-328 +Here is a [link](). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^^^^ markup.underline.link.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.end.markdown -`foo` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^ meta.paragraph.markdown markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown +Here is a [link](http://example.com?foo=3#frag). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-329 +Not a [link] (url) due to space. +| ^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^ - meta.link -`` foo ` bar `` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^^^^^^^^^^^^ markup.raw.inline.markdown -|^ punctuation.definition.raw.begin.markdown -| ^ - punctuation -| ^^ punctuation.definition.raw.end.markdown +Here is a [reference link][name]. +| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^ meta.link.reference.metadata.markdown +| ^ punctuation.definition.link.begin.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-330 +Here is a [reference link][name]{_attr='value' :att2}. +| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^ meta.link.reference.metadata.markdown +| ^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.attributes.markdown +| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown +| ^ - meta.attribute-with-value +| ^^^^^ meta.attribute-with-value.markdown +| ^ punctuation.definition.link.begin.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^^^ string.quoted.single.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.definition.attributes.end.markdown -` `` ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^^ markup.raw.inline.markdown -| ^^ - punctuation -| ^ punctuation.definition.raw.end.markdown +Here is a [blank reference link][]{}. +| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.literal.description.markdown +| ^^ meta.link.reference.literal.metadata.markdown +| ^^ meta.link.reference.literal.attributes.markdown +| ^ punctuation.definition.link.begin.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.attributes.begin.markdown +| ^ punctuation.definition.attributes.end.markdown -## https://spec.commonmark.org/0.30/#example-331 +now you can access the [The Ever Cool Site: Documentation about Sites]( + www.thecoolsite.com.ca/documentations/about/cool ) for more information about... +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline markup.underline.link +| ^ - invalid +| ^ meta.link.inline punctuation.definition.metadata.end -` `` ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^^^^ markup.raw.inline.markdown -| ^^ - punctuation -| ^ punctuation.definition.raw.end.markdown +now you can access the [The Ever Cool Site: Documentation about Sites]( + www.thecoolsite.com.ca /documentations/about/cool ) for more information about... +| ^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inline markup.underline.link +| ^ meta.paragraph meta.link.inline - markup.underline.link +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - meta.link.inline -## https://spec.commonmark.org/0.30/#example-332 +now you can access the [The Ever Cool Site: Documentation about Sites]( + www.thecoolsite.com.ca/documentations/about/cool + (title)) for more information about... +| ^^^^^^^^ meta.paragraph meta.link.inline +| ^ punctuation.definition.metadata.end +| ^^^^^^^ string.quoted.other.markdown -` a` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown +link with a single underscore inside the text : [@_test](http://example.com) +| ^^^^^^ meta.paragraph meta.link.inline.description - punctuation.definition +| ^ meta.paragraph meta.link.inline punctuation.definition.link.end -## https://spec.commonmark.org/0.30/#example-333 +[foo] +|<- meta.link.reference punctuation.definition.link.begin +|^^^ meta.paragraph meta.link.reference +| ^ meta.link.reference punctuation.definition.link.end -` b ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown +This is literal [Foo*bar\]] but [ref][Foo*bar\]] +| ^^^^^^^^^^^ meta.link.reference.description.markdown +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^ - constant +| ^^ constant.character.escape.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^^^ meta.link.reference.metadata.markdown -## https://spec.commonmark.org/0.30/#example-334 +[**Read more →**][details] +|^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^ meta.link.reference.metadata.markdown +|^^ punctuation.definition.bold.begin.markdown +| ^^^^^^^ constant.character.entity.decimal.html +| ^^ punctuation.definition.bold.end.markdown +| ^^^^^^^ markup.underline.link.markdown -` ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown -| ^ - markup +[Read more →][details] +|^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^ meta.link.reference.metadata.markdown +| ^^^^^^^ constant.character.entity.decimal.html +| ^^^^^^^ markup.underline.link -` ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown -| ^ - markup +[Read more ][details] +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^ meta.link.reference.metadata.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.tag +| ^^^^^^^^^^^^^^^^^^ source.css +| ^^^^^^^ constant.character.entity.decimal.html - meta.tag +| ^^^^^^^ meta.tag +| ^^^^^^^ markup.underline.link -## https://spec.commonmark.org/0.30/#example-335 +[![Cool ★ Image - Click to Enlarge][img-example]][img-example] +| <- meta.link.reference.description.markdown punctuation.definition.link.begin.markdown +|^^ meta.link.reference.description.markdown meta.image.reference.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown meta.image.reference.description.markdown +| ^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^^^^^ meta.link.reference.metadata.markdown +|^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata.end.markdown -`` -foo -bar -baz -`` -| <- markup.raw.inline.markdown punctuation.definition.raw.end.markdown -|^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown +[![Cool ★ Image - Click to Enlarge](http://www.sublimetext.com/anim/rename2_packed.png)](http://www.sublimetext.com/anim/rename2_packed.png) +| <- meta.paragraph.markdown meta.link.inline.description.markdown punctuation.definition.link.begin.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inline.description.markdown meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inline.description.markdown meta.image.inline.metadata.markdown +| ^ meta.paragraph.markdown meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inline.metadata.markdown +|^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-336 +[link [containing] [square] brackets](#backticks) +|<- punctuation.definition.link.begin +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description +| ^ punctuation.definition.link.end -`` -foo -`` -| <- markup.raw.inline.markdown punctuation.definition.raw.end.markdown -|^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown +[link `containing square] brackets] in backticks`[]](#wow) +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description +| ^ punctuation.definition.raw.begin +| ^ punctuation.definition.raw.end +| ^ punctuation.definition.link.end -## https://spec.commonmark.org/0.30/#example-337 +[link ``containing square]` brackets[[][] in backticks``](#wow) +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.inline +| ^^ punctuation.definition.raw.begin +| ^^ punctuation.definition.raw.end +| ^ punctuation.definition.link.end -`foo bar - baz` -|^^^^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown +This is a [reference] () +| ^^^^^^^^^^^ meta.link.reference +| ^^^^ - meta.link -## https://spec.commonmark.org/0.30/#example-338 +This is a [reference] (followed by parens) +| ^^^^^^^^^^^ meta.link.reference +| ^^^^^^^^^^^^^^^^^^^^^ - meta.link -`foo\`bar` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^^ markup.raw.inline.markdown -| ^^^ - markup.raw +This is a [reference] [] +| ^^^^^^^^^^^ meta.link.reference +| ^ - meta.link +| ^^ meta.link.reference -## https://spec.commonmark.org/0.30/#example-339 +This is a ![reference] () +| ^^^^^^^^^^^^^^^ - meta.image +| ^^^^^^^^^^^ meta.link.reference +| ^^^^ - meta.link -``foo`bar`` -| <- meta.paragraph.markdown markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^^^^^^^ meta.paragraph.markdown markup.raw.inline.markdown -|^ punctuation.definition.raw.begin.markdown -| ^^^^^^^ - punctuation -| ^^ punctuation.definition.raw.end.markdown +This is a ![reference] (followed by parens) +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.image +| ^^^^^^^^^^^ meta.link.reference +| ^^^^^^^^^^^^^^^^^^^^^ - meta.link -````bar```` baz -|^^^^^^^^^^ markup.raw.inline.markdown -| ^^^^^ - markup.raw +This is a ![reference] [] +| ^^^^^^^^^^^^^^^ - meta.image +| ^^^^^^^^^^^ meta.link.reference +| ^ - meta.link +| ^^ meta.link.reference -## https://spec.commonmark.org/0.30/#example-340 -`foo `` bar` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^^^^^^^ markup.raw.inline.markdown - punctuation -| ^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown +# TEST: IMAGES ################################################################ -## https://spec.commonmark.org/0.30/#example-341 +Here is a ![](https://example.com/cat.gif). +| ^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown -*foo`*` -| <- markup.italic.markdown punctuation.definition.italic.begin.markdown -| ^^^ markup.italic.markdown markup.raw.inline.markdown +Here is a ![](https://example.com/cat.gif){_at"r=value :att2}. +| ^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^^^^^^^^^^^^^^^^^^ meta.image.inline.attributes.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ invalid.illegal.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^ string.unquoted.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.definition.attributes.end.markdown -| <- invalid.illegal.non-terminated.bold-italic +Here is a ![Image Alt Text](https://example.com/cat.gif). +| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-342 +Here is a ![Image Alt Text]( https://example.com/cat.gif ). +| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^ - markup.underline +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^^ - markup.underline +| ^ punctuation.definition.metadata.end.markdown -[not a `link](/foo`) -|^^^^^^^^^^^^^^^^^^^ - meta.link -| ^^^^^^^^^^^^ markup.raw.inline.markdown +Here is a ![Image Alt Text]( + https://example.com/cat.gif ). +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-343 +Here is a ![Image Alt Text]( + https://example.com/cat.gif + "hello" ). +|^^^^^^^ meta.image.inline string.quoted.double +| ^^^^ meta.image.inline +| ^ punctuation.definition.metadata.end -`` -|^^^^^^^^^^ markup.raw.inline.markdown -| ^^ - markup.raw +Here is a ![Image Alt Text]( + "hello" ). +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown +| ^^ meta.paragraph.markdown - meta.image +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^^^ string.quoted.double.markdown +| ^ punctuation.definition.string.begin.markdown +| ^ punctuation.definition.string.end.markdown +| ^ punctuation.definition.metadata.end.markdown -| <- invalid.illegal.non-terminated.raw +Here is a ![Image Alt Text]( + (hello) ). +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown +| ^^ meta.paragraph.markdown - meta.image +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^^^ string.quoted.other.markdown +| ^ punctuation.definition.string.begin.markdown +| ^ punctuation.definition.string.end.markdown +| ^ punctuation.definition.metadata.end.markdown -## https://spec.commonmark.org/0.30/#example-344 +Here is a ![Image Alt Text]( + https://example .com /cat.gif (hello) ). +|^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline +| ^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown markup.underline.link.image.markdown +| ^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.image - markup.underline -` -| ^^^^^^^^^ meta.tag.inline.a -| ^ punctuation.definition.raw.begin +Here is a ![Image Ref Alt][1]. +| ^^^^^^^^^^^^^^^^ meta.image.reference.description.markdown +| ^^^ meta.image.reference.metadata.markdown +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown -| <- invalid.illegal.non-terminated.raw -## https://spec.commonmark.org/0.30/#example-345 +# TEST: FOOTNOTES ############################################################# -`` -|^^^^^^^^^^^^^^^^^ markup.raw.inline -| ^ punctuation.definition.raw.begin -| <- invalid.illegal.non-terminated.raw +## https://michelf.ca/projects/php-markdown/extra/#footnotes -## https://spec.commonmark.org/0.30/#example-346 +That's some text with a footnote.[^1] +| ^^^^ meta.paragraph meta.link.reference.footnote.markdown-extra +| ^ punctuation.definition.link.begin +| ^^ meta.link.reference.literal.footnote-id +| ^ punctuation.definition.link.end -` -|^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.raw.begin +Here is a footnote[^1][link][] or long[^longnote][link][]. +| ^^^^ meta.link.reference.footnote.markdown-extra +| ^^^^^^ meta.link.reference.literal.description.markdown +| ^^ meta.link.reference.literal.metadata.markdown +| ^^^^^^^^^^^ meta.link.reference.footnote.markdown-extra +| ^^^^^^^^ meta.link.reference.literal -| <- invalid.illegal.non-terminated.raw +Here is a footnote [^footnote](not_link_dest). +| ^^^^^^^^^^^ meta.paragraph.markdown meta.link.reference.footnote.markdown-extra +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^ meta.link.reference.literal.footnote-id.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.link # TEST: COMMONMARK AUTOLINKS ################################################## @@ -3874,57 +4013,6 @@ _italic text HTML element end of italic text_ | ^^^^^^ meta.tag.inline.any.html | ^^^^^^^ meta.tag.inline.any.html -[link [containing] [square] brackets](#backticks) -|<- punctuation.definition.link.begin -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.link.end -[link `containing square] brackets] in backticks`[]](#wow) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.raw.begin -| ^ punctuation.definition.raw.end -| ^ punctuation.definition.link.end -[link ``containing square]` brackets[[][] in backticks``](#wow) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.inline -| ^^ punctuation.definition.raw.begin -| ^^ punctuation.definition.raw.end -| ^ punctuation.definition.link.end -`inline markup ` -| ^^^^^^^^^^^^^ markup.raw.inline - meta.tag.inline.any.html -escaped backtick \`this is not code\` -| ^^ constant.character.escape -| ^^ constant.character.escape -| ^^^^^^^^^^^^^^^^ - markup.raw.inline - -This is a [reference] () -| ^^^^^^^^^^^ meta.link.reference -| ^^^^ - meta.link - -This is a [reference] (followed by parens) -| ^^^^^^^^^^^ meta.link.reference -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link - -This is a [reference] [] -| ^^^^^^^^^^^ meta.link.reference -| ^ - meta.link -| ^^ meta.link.reference - -This is a ![reference] () -| ^^^^^^^^^^^^^^^ - meta.image -| ^^^^^^^^^^^ meta.link.reference -| ^^^^ - meta.link - -This is a ![reference] (followed by parens) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.image -| ^^^^^^^^^^^ meta.link.reference -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link - -This is a ![reference] [] -| ^^^^^^^^^^^^^^^ - meta.image -| ^^^^^^^^^^^ meta.link.reference -| ^ - meta.link -| ^^ meta.link.reference - http://spec.commonmark.org/0.27/#example-328 *foo bar* | <- punctuation.definition.italic.begin @@ -4633,43 +4721,6 @@ _foo [**bar**](/url)_ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list markup.raw.inline 2. Choose `Package Control: Install Package` -[**Read more →**][details] -|^^ punctuation.definition.bold.begin -| ^^^^^^^ constant.character.entity.decimal.html -| ^^ punctuation.definition.bold.end -| ^^^^^^^ markup.underline.link - -[Read more →][details] -| ^^^^^^^ constant.character.entity.decimal.html -| ^^^^^^^ markup.underline.link - -[Read more ][details] -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description -| ^^^^^^^^^^^^^^^^^^ source.css -| ^^^^^^^ constant.character.entity.decimal.html -| ^^^^^^^ markup.underline.link - -[![Cool ★ Image - Click to Enlarge][img-example]][img-example] -|^ punctuation.definition.image.begin -| ^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.link.end -| ^^^^^^^^^^^ markup.underline.link - -[![Cool ★ Image - Click to Enlarge](http://www.sublimetext.com/anim/rename2_packed.png)](http://www.sublimetext.com/anim/rename2_packed.png) -|^ punctuation.definition.image.begin -| ^ punctuation.definition.metadata.begin -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end -| ^ punctuation.definition.metadata.begin -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata.end - -https://michelf.ca/projects/php-markdown/extra/#footnotes -That's some text with a footnote.[^1] -| ^^^^ meta.paragraph meta.link.reference.footnote.markdown-extra -| ^ punctuation.definition.link.begin -| ^^ meta.link.reference.literal.footnote-id -| ^ punctuation.definition.link.end - a - b @@ -4781,23 +4832,6 @@ Test 1. Test 2 |^ markup.list.numbered.bullet punctuation.definition.list_item -link with a single underscore inside the text : [@_test](http://example.com) -| ^^^^^^ meta.paragraph meta.link.inline.description - punctuation.definition -| ^ meta.paragraph meta.link.inline punctuation.definition.link.end - -[foo] -|<- meta.link.reference punctuation.definition.link.begin -|^^^ meta.paragraph meta.link.reference -| ^ meta.link.reference punctuation.definition.link.end - -This is literal [Foo*bar\]] but [ref][Foo*bar\]] -| ^^^^^^^^^^^ meta.link.reference.description.markdown -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^ - constant -| ^^ constant.character.escape.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^^^ meta.link.reference.metadata.markdown # TEST: CRITIC MARKUP ######################################################### From 2ce0f96c8910cc7e37ee05cd26f513e5e721a2b5 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 20:48:49 +0100 Subject: [PATCH 22/63] Syntax: Reorganize list tests This commit moves existing list related tests to a dedicated section. --- tests/syntax_test_markdown.md | 1101 +++++++++++++++++---------------- 1 file changed, 564 insertions(+), 537 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index fc5f00d1..4ddd3780 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1080,69 +1080,6 @@ Fenced codeblocks are no no setext heading |^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -Paragraph of text that should be scoped as meta.paragraph. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - - 1. Ordered list item -| ^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered -| ^^ markup.list.numbered.bullet - markup.list.numbered markup.list.numbered -| ^ punctuation.definition.list_item - 2. Ordered list item #2 -| ^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered - markup.list.numbered markup.list.numbered -| ^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item - 1. Subitem - 2. Another subitem -|^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered -| ^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item -| ^^^^^^^^^^^^^^^^ meta.paragraph.list - meta.paragraph.list meta.paragraph.list - -Paragraph break. - - - Unordered list item -| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - - Unordered list item #2 -| ^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - -Paragraph break. - -- `` | `` (components/Logo.vue) -- `` | `` | (components/my-component.vue) -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown - -Paragraph break. - - * Unordered list item -| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - + Unordered list item #2 -| ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - + Subitem 1 -| ^ punctuation.definition.list_item - + Item - + Subitem - + Another subitem -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - meta.paragraph.list -| ^^^^^^^^^^^^^^^ meta.paragraph.list - + Nested Subitem -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - markup.list.unnumbered markup.list.unnumbered - + Nested + Subitem -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -| ^ - punctuation.definition.list_item - - * Unsorted list item - ```xml -|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -| ^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm constant.other.language-name.markdown - -|^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown markup.raw.code-fence.xml.markdown-gfm text.xml meta.tag.xml - ``` -|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown # TEST: BLOCK QUOTES ########################################################## @@ -2915,112 +2852,568 @@ A line with bolded **|** | ^ - punctuation.separator.table-cell -# TEST: CODE SPANS ############################################################ +# TEST: LIST BLOKCKS ########################################################## -```testing``123``` -| <- punctuation.definition.raw.begin -| ^^ - punctuation -| ^^^ punctuation.definition.raw.end +Paragraph of text that should be scoped as meta.paragraph. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph -```testing``123```` -| <- punctuation.definition.raw.begin -| ^ - punctuation -| ^^^^ - punctuation -``` -| <- punctuation.definition.raw.end +Paragraph followed immediately by a list, no blank line in between +- list item 1 +| <- markup.list.unnumbered punctuation.definition.list_item -``testing`123```` -| <- punctuation.definition.raw.begin -| ^ - punctuation -| ^^^^ - punctuation -more text`` -| ^^ punctuation.definition.raw.end +Paragraph followed immediately by a numbered list, no blank line in between +1. list item 1 +| <- markup.list.numbered.bullet.markdown +|^^^^^^^^^^^^^ markup.list.numbered +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^^^ meta.paragraph.list + more text - this punctuation should be ignored 2. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list +| ^ - punctuation.definition.list_item +| ^ - punctuation.definition.list_item -``text +Paragraph not followed immediately by a numbered list, +because it doesn't begin with the number one: +2. text +| <- - markup.list.numbered +|^^^^^^ - markup.list.numbered -| <- invalid.illegal.non-terminated.raw -text -| <- - markup.raw + 1. Ordered list item +| ^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered +| ^^ markup.list.numbered.bullet - markup.list.numbered markup.list.numbered +| ^ punctuation.definition.list_item + 2. Ordered list item #2 +| ^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered - markup.list.numbered markup.list.numbered +| ^^ markup.list.numbered.bullet +| ^ punctuation.definition.list_item + 1. Subitem + 2. Another subitem +|^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered +| ^^ markup.list.numbered.bullet +| ^ punctuation.definition.list_item +| ^^^^^^^^^^^^^^^^ meta.paragraph.list - meta.paragraph.list meta.paragraph.list -## https://spec.commonmark.org/0.30/#example-327 +Paragraph break. -`hi`lo` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown -| ^^ - markup.raw +1) numberd item +| <- markup.list.numbered.bullet.markdown +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^^^^^ markup.list.numbered.markdown -## https://spec.commonmark.org/0.30/#example-328 + 2) numberd item +| <- markup.list.numbered.markdown +|^^ markup.list.numbered.bullet.markdown +| ^^^^^^^^^^^^^^ markup.list.numbered.markdown -`foo` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^ meta.paragraph.markdown markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown + 3) numberd item +| <- markup.list.numbered.markdown +|^ markup.list.numbered.markdown +| ^^ markup.list.numbered.bullet.markdown +| ^^^^^^^^^^^^^^ markup.list.numbered.markdown -## https://spec.commonmark.org/0.30/#example-329 + 4) numberd item +| <- markup.list.numbered.markdown +|^^ markup.list.numbered.markdown +| ^^ markup.list.numbered.bullet.markdown +| ^^^^^^^^^^^^^^ markup.list.numbered.markdown -`` foo ` bar `` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^^^^^^^^^^^^ markup.raw.inline.markdown -|^ punctuation.definition.raw.begin.markdown -| ^ - punctuation -| ^^ punctuation.definition.raw.end.markdown + 5) numberd item +| <- markup.list.numbered.markdown +|^^^ markup.list.numbered.markdown +| ^^ markup.list.numbered.bullet.markdown +| ^^^^^^^^^^^^^^ markup.list.numbered.markdown -## https://spec.commonmark.org/0.30/#example-330 +Paragraph break. -` `` ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^^ markup.raw.inline.markdown -| ^^ - punctuation -| ^ punctuation.definition.raw.end.markdown + 5) code block +| <- markup.raw.block.markdown - markup.list +|^^^^^^^^^^^^^^^^^ markup.raw.block.markdown - markup.list -## https://spec.commonmark.org/0.30/#example-331 +Paragraph break. -` `` ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^^^^ markup.raw.inline.markdown -| ^^ - punctuation -| ^ punctuation.definition.raw.end.markdown + - Unordered list item +| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item + - Unordered list item #2 +| ^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -## https://spec.commonmark.org/0.30/#example-332 +Paragraph break. -` a` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown +- `` | `` (components/Logo.vue) +- `` | `` | (components/my-component.vue) +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown -## https://spec.commonmark.org/0.30/#example-333 +Paragraph break. -` b ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown + * Unordered list item +| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item + + Unordered list item #2 +| ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item + + Subitem 1 +| ^ punctuation.definition.list_item + + Item + + Subitem + + Another subitem +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - meta.paragraph.list +| ^^^^^^^^^^^^^^^ meta.paragraph.list + + Nested Subitem +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - markup.list.unnumbered markup.list.unnumbered + + Nested + Subitem +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item +| ^ - punctuation.definition.list_item -## https://spec.commonmark.org/0.30/#example-334 + * Unsorted list item + ```xml +|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm constant.other.language-name.markdown + +|^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown markup.raw.code-fence.xml.markdown-gfm text.xml meta.tag.xml + ``` +|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -` ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown -| ^ - markup +> Block quote with list items +> - list item 1 +| ^ markup.quote punctuation.definition.list_item +> - list item 2 +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item +| ^^^^^^^^^^^^^^ markup.quote markup.list.unnumbered +| ^^^^^^^^^^^^ meta.paragraph.list +> 1. sub list item +| <- markup.quote punctuation.definition.blockquote +|^^^^^^^^^^^^^^^^^^^^ markup.quote +| ^ punctuation.definition.list_item +| ^^ markup.list.numbered.bullet +| ^^^^^^^^^^^^^^^^^^^ markup.list.numbered +| ^^^^^^^^^^^^^^ meta.paragraph.list +> - list item 3 + continued +| ^^^^^^^^^^ markup.quote.markdown markup.list.unnumbered.markdown meta.paragraph.list.markdown -` ` -| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown -|^^^ markup.raw.inline.markdown -| ^ punctuation.definition.raw.end.markdown -| ^ - markup +* this is a list -## https://spec.commonmark.org/0.30/#example-335 + > This is a blockquote. +| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote -`` -foo -bar -baz -`` -| <- markup.raw.inline.markdown punctuation.definition.raw.end.markdown -|^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown + - this is a list + > This is a blockquote. +| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote -## https://spec.commonmark.org/0.30/#example-336 + This is a paragraph still part of the + list item +| ^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - meta.paragraph.list meta.paragraph.list + +* Lorem ipsum + + This is a code block +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered markup.raw.block +* list continues +| <- markup.list.unnumbered punctuation.definition.list_item - markup.raw.block +* list continues + +Paragraph break. +| <- meta.paragraph - markup + +* [ ] Unticked GitHub-flavored-markdown checkbox +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +* [x] Ticked GFM checkbox +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +* [X] Another ticked checkbox +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm + + [ ] Sub-item with checkbox +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +* [] Not a checkbox +| ^^^^^^^^^^^^^^^^^ - storage - constant +* [/] Not a checkbox +| ^^^^^^^^^^^^^^^^^^ - storage +* Not [ ] a [x] checkbox [X] +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - storage - constant +* [ ] [Checkbox][] with next word linked +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +| ^^^^^^^^^^^^ meta.link +* list has `unclosed code +* list continues +| ^^^^^^^^^^^^^^^ - markup.raw + +> * [ ] task +| ^^^^^^^^^^^ markup.quote.markdown +| ^ markup.list.unnumbered.bullet.markdown +| ^^^^^^^^^^ markup.list.unnumbered.markdown +| ^ punctuation.definition.list_item.markdown +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +> * [x] task +| ^^^^^^^^^^^ markup.quote.markdown +| ^ markup.list.unnumbered.bullet.markdown +| ^^^^^^^^^^ markup.list.unnumbered.markdown +| ^ punctuation.definition.list_item.markdown +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +> * [X] task +| ^^^^^^^^^^^ markup.quote.markdown +| ^ markup.list.unnumbered.bullet.markdown +| ^^^^^^^^^^ markup.list.unnumbered.markdown +| ^ punctuation.definition.list_item.markdown +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +> * [X] task +> - [ ] task +| ^^^^^^^^^^^^^ markup.quote.markdown +| ^ markup.list.unnumbered.bullet.markdown +| ^^^^^^^^^^ markup.list.unnumbered.markdown +| ^ punctuation.definition.list_item.markdown +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm + +* list item + +

*no-markdown*

+| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown +| ^^^^ meta.tag + - list item + +

*no-markdown*

+| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown +| ^^^^ meta.tag + +- `code` -
+| ^ markup.list.unnumbered meta.paragraph.list markup.raw.inline punctuation.definition.raw +| ^^^^^^^^^^^^^^^^^^^ meta.tag.inline.a.html + 3. [see `demo`](#demo "demo") +| ^ punctuation.definition.list_item +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline +| ^^^^^^^^^^ meta.link.inline.description +| ^ punctuation.definition.metadata.begin +| ^ punctuation.definition.string.begin +| ^ punctuation.definition.string.end +| ^ punctuation.definition.metadata.end + [see `demo`](#demo (demo)) +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline +| ^^^^^^^^^^ meta.link.inline.description +| ^ punctuation.definition.metadata.begin +| ^ punctuation.definition.string.begin +| ^ punctuation.definition.string.end +| ^ punctuation.definition.metadata.end + [see `demo`](#demo 'demo') +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline +| ^^^^^^^^^^ meta.link.inline.description +| ^ punctuation.definition.metadata.begin +| ^ punctuation.definition.string.begin +| ^ punctuation.definition.string.end +| ^ punctuation.definition.metadata.end + Here is a ![example image](https://test.com/sublime.png "A demonstration"). +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.image.inline +| ^^ punctuation.definition.image.begin +| ^^^^^^^^^^^^^ meta.image.inline.description +| ^ punctuation.definition.image.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^^^^^^^^^^^^^^^^^ string.quoted.double +| ^ punctuation.definition.string.begin +| ^ punctuation.definition.string.end +| ^ punctuation.definition.metadata + Here is a ![example image](https://test.com/sublime.png 'A demonstration'). +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.image.inline +| ^^ punctuation.definition.image.begin +| ^^^^^^^^^^^^^ meta.image.inline.description +| ^ punctuation.definition.image.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^^^^^^^^^^^^^^^^^ string.quoted.single +| ^ punctuation.definition.string.begin +| ^ punctuation.definition.string.end +| ^ punctuation.definition.metadata + Here is a ![example image](https://test.com/sublime.png (A demonstration)). +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.image.inline +| ^^ punctuation.definition.image.begin +| ^^^^^^^^^^^^^ meta.image.inline.description +| ^ punctuation.definition.image.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^^^^^^^^^^^^^^^^^ string.quoted.other +| ^ punctuation.definition.string.begin +| ^ punctuation.definition.string.end +| ^ punctuation.definition.metadata + +- test *testing +blah* +| ^ markup.list.unnumbered meta.paragraph.list markup.italic punctuation.definition.italic.end - meta.paragraph.list meta.paragraph.list +- fgh +- *ghgh +| ^ markup.list.unnumbered meta.paragraph.list markup.italic punctuation.definition.italic.begin - meta.paragraph.list meta.paragraph.list +- fgfg +| <- markup.list.unnumbered.bullet punctuation.definition.list_item +- _test + +| <- markup.list.unnumbered meta.paragraph.list markup.italic invalid.illegal.non-terminated.bold-italic + still a list item +| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list +- * * * * * * * +| <- punctuation.definition.list_item +| ^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.separator.thematic-break - meta.paragraph.list meta.paragraph.list +| ^ punctuation.definition.thematic-break +| ^ punctuation.definition.thematic-break +| ^ punctuation.definition.thematic-break +| ^ punctuation.definition.thematic-break +| ^ punctuation.definition.thematic-break +| ^ punctuation.definition.thematic-break +| ^ punctuation.definition.thematic-break +| ^ - punctuation.definition.thematic-break +| ^ - punctuation.definition.thematic-break +| ^ - punctuation.definition.thematic-break +| ^ - punctuation.definition.thematic-break +| ^ - punctuation.definition.thematic-break +| ^ - punctuation.definition.thematic-break + still a list item +| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - meta.paragraph.list meta.paragraph.list + +Paragraph break. + +1. Open `Command Palette` using menu item `Tools → Command Palette...` +|^ markup.list.numbered punctuation.definition.list_item +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list markup.raw.inline +2. Choose `Package Control: Install Package` +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.paragraph.list.markdown markup.raw.inline.markdown + +Paragraph break. + +- a + - b + - c + - d +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item + text here +| ^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - markup.raw.block - meta.paragraph.list meta.paragraph.list + + code here + | ^^^^^^^^ markup.raw.block + + - e +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item + + code here + + > block quote code here +| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote +| ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered markup.quote markup.raw.block + + > > test +| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote +| ^ markup.list.unnumbered markup.quote markup.quote punctuation.definition.blockquote - markup.raw.block + + - f +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item + 1. test +| ^^ markup.list.numbered.bullet +| ^ punctuation.definition.list_item + +Paragraph break. +| <- meta.paragraph - markup + +1. test +| ^^^^^ markup.list.numbered meta.paragraph.list + - test +|^^^^^^^^^ markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item +| ^^^^^ meta.paragraph.list + - test +|^^^^^^^^^ markup.list.unnumbered +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item +| ^^^^^ meta.paragraph.list + test +|^^^^^^^ markup.list.numbered meta.paragraph.list + ****test**** +|^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list - punctuation + + - - test +|^ punctuation.definition.list_item +| ^^^^^^^ markup.list.unnumbered meta.paragraph.list - punctuation +- - - - test +| <- punctuation.definition.list_item +| ^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - punctuation + +Paragraph break. +| <- meta.paragraph - markup + + * List Item 1 + Text under Item 1 + * List Item 2 + Text under Item 2 + + * List Item 3 + Text under Item 3 +| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - markup.raw + + 1. fenced code block inside a list item +| ^ punctuation.definition.list_item + ```language +|^^^^^^^^^^^^^^^ meta.paragraph.list +| ^^^ punctuation.definition.raw.code-fence.begin +| ^^^^^^^^ constant.other.language-name +| ^^^^^^^^^^^ meta.code-fence + +|^^^^ meta.paragraph.list markup.raw.code-fence + ``` +| ^^^ punctuation.definition.raw.code-fence.end + test +| ^^^^^ meta.paragraph.list - markup.raw.code-fence + + 2. test +| ^ punctuation.definition.list_item + +Paragraph break. +| <- meta.paragraph - markup + +1. List + 1. Nested list + 2. Second item + + This line is still list item 1 +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered - markup.raw.block + +Paragraph break. +| <- meta.paragraph - markup + +1. Test + + ```python +| ^^^ markup.list.numbered meta.code-fence punctuation.definition.raw.code-fence.begin + Test + +| <- - invalid + Test + ``` +| ^^^ punctuation.definition.raw.code-fence.end + +1. Test 2 +|^ markup.list.numbered.bullet punctuation.definition.list_item + + +# TEST: CODE SPANS ############################################################ + +```testing``123``` +| <- punctuation.definition.raw.begin +| ^^ - punctuation +| ^^^ punctuation.definition.raw.end + +```testing``123```` +| <- punctuation.definition.raw.begin +| ^ - punctuation +| ^^^^ - punctuation +``` +| <- punctuation.definition.raw.end + +``testing`123```` +| <- punctuation.definition.raw.begin +| ^ - punctuation +| ^^^^ - punctuation +more text`` +| ^^ punctuation.definition.raw.end + +``text + +| <- invalid.illegal.non-terminated.raw +text +| <- - markup.raw + +## https://spec.commonmark.org/0.30/#example-327 + +`hi`lo` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown +| ^^ - markup.raw + +## https://spec.commonmark.org/0.30/#example-328 + +`foo` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^ meta.paragraph.markdown markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-329 + +`` foo ` bar `` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^^^^^^^^^ markup.raw.inline.markdown +|^ punctuation.definition.raw.begin.markdown +| ^ - punctuation +| ^^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-330 + +` `` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^ markup.raw.inline.markdown +| ^^ - punctuation +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-331 + +` `` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^^^^ markup.raw.inline.markdown +| ^^ - punctuation +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-332 + +` a` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-333 + +` b ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-334 + +` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown +| ^ - markup + +` ` +| <- markup.raw.inline.markdown punctuation.definition.raw.begin.markdown +|^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.end.markdown +| ^ - markup + +## https://spec.commonmark.org/0.30/#example-335 + +`` +foo +bar +baz +`` +| <- markup.raw.inline.markdown punctuation.definition.raw.end.markdown +|^ markup.raw.inline.markdown punctuation.definition.raw.end.markdown + +## https://spec.commonmark.org/0.30/#example-336 `` foo @@ -3725,257 +4118,40 @@ Anonymous FTP is available at ftp://foo.bar.baz. | ^ punctuation.separator.path.markdown | ^^ - markup.underline.link -foo@bar.baz -| <- meta.link.email.markdown markup.underline.link.markdown -|^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -| ^ punctuation.separator.path.markdown -| ^ - meta.link - markup.underline.link - -hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.link - markup.underline.link -| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown - - test@test.test.me -| <- - meta.link - markup.underline -|^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -| ^ punctuation.separator.path.markdown -| ^ - meta.link - markup.underline.link - - a.b-c_d@a.b -| <- - meta.link - markup.underline -|^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -| ^ punctuation.separator.path.markdown -| ^ - meta.link - markup.underline.link - -a.b-c_d@a.b. -|^^^^^^^^^^ markup.underline.link -| ^^ - markup.underline.link - - a.b-c_d@a.b- -| <- - meta.link - markup.underline -|^^^^^^^^^^^^^ - meta.link - markup.underline.link - - a.b-c_d@a.b_ -| <- - meta.link - markup.underline -|^^^^^^^^^^^^^ - meta.link - markup.underline.link - - -Paragraph followed immediately by a list, no blank line in between -- list item 1 -| <- markup.list.unnumbered punctuation.definition.list_item - -Paragraph followed immediately by a numbered list, no blank line in between - 1. list item 1 -|^^^^^^^^^^^^^^^ markup.list.numbered -|^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item -| ^^^^^^^^^^^^ meta.paragraph.list - more text - this punctuation should be ignored 2. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list -| ^ - punctuation.definition.list_item -| ^ - punctuation.definition.list_item - -Paragraph not followed immediately by a numbered list, -because it doesn't begin with the number one: - 2. text -| ^ - markup.list.numbered - punctuation.definition.list_item - - -> Block quote with list items -> - list item 1 -| ^ markup.quote punctuation.definition.list_item -> - list item 2 -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -| ^^^^^^^^^^^^^^ markup.quote markup.list.unnumbered -| ^^^^^^^^^^^^ meta.paragraph.list -> 1. sub list item -| <- markup.quote punctuation.definition.blockquote -|^^^^^^^^^^^^^^^^^^^^ markup.quote -| ^ punctuation.definition.list_item -| ^^ markup.list.numbered.bullet -| ^^^^^^^^^^^^^^^^^^^ markup.list.numbered -| ^^^^^^^^^^^^^^ meta.paragraph.list -> - list item 3 - continued -| ^^^^^^^^^^ markup.quote.markdown markup.list.unnumbered.markdown meta.paragraph.list.markdown - -* this is a list - - > This is a blockquote. -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote - - - this is a list - > This is a blockquote. -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote - - This is a paragraph still part of the - list item -| ^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - meta.paragraph.list meta.paragraph.list - -* Lorem ipsum - - This is a code block -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered markup.raw.block -* list continues -| <- markup.list.unnumbered punctuation.definition.list_item - markup.raw.block -* list continues -* [ ] Unticked GitHub-flavored-markdown checkbox -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -* [x] Ticked GFM checkbox -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -* [X] Another ticked checkbox -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm - + [ ] Sub-item with checkbox -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -* [] Not a checkbox -| ^^^^^^^^^^^^^^^^^ - storage - constant -* [/] Not a checkbox -| ^^^^^^^^^^^^^^^^^^ - storage -* Not [ ] a [x] checkbox [X] -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - storage - constant -* [ ] [Checkbox][] with next word linked -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -| ^^^^^^^^^^^^ meta.link -* list has `unclosed code -* list continues -| ^^^^^^^^^^^^^^^ - markup.raw - -> * [ ] task -| ^^^^^^^^^^^ markup.quote.markdown -| ^ markup.list.unnumbered.bullet.markdown -| ^^^^^^^^^^ markup.list.unnumbered.markdown -| ^ punctuation.definition.list_item.markdown -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -> * [x] task -| ^^^^^^^^^^^ markup.quote.markdown -| ^ markup.list.unnumbered.bullet.markdown -| ^^^^^^^^^^ markup.list.unnumbered.markdown -| ^ punctuation.definition.list_item.markdown -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -> * [X] task -| ^^^^^^^^^^^ markup.quote.markdown -| ^ markup.list.unnumbered.bullet.markdown -| ^^^^^^^^^^ markup.list.unnumbered.markdown -| ^ punctuation.definition.list_item.markdown -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -> * [X] task -> - [ ] task -| ^^^^^^^^^^^^^ markup.quote.markdown -| ^ markup.list.unnumbered.bullet.markdown -| ^^^^^^^^^^ markup.list.unnumbered.markdown -| ^ punctuation.definition.list_item.markdown -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +foo@bar.baz +| <- meta.link.email.markdown markup.underline.link.markdown +|^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown +| ^ punctuation.separator.path.markdown +| ^ - meta.link - markup.underline.link -* list item - -

*no-markdown*

-| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown -| ^^^^ meta.tag - - list item +hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.link - markup.underline.link +| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -

*no-markdown*

-| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown -| ^^^^ meta.tag + test@test.test.me +| <- - meta.link - markup.underline +|^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown +| ^ punctuation.separator.path.markdown +| ^ - meta.link - markup.underline.link -- `code` - -| ^ markup.list.unnumbered meta.paragraph.list markup.raw.inline punctuation.definition.raw -| ^^^^^^^^^^^^^^^^^^^ meta.tag.inline.a.html - 3. [see `demo`](#demo "demo") -| ^ punctuation.definition.list_item -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline -| ^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.metadata.begin -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata.end - [see `demo`](#demo (demo)) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline -| ^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.metadata.begin -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata.end - [see `demo`](#demo 'demo') -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline -| ^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.metadata.begin -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata.end - Here is a ![example image](https://test.com/sublime.png "A demonstration"). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.image.inline -| ^^ punctuation.definition.image.begin -| ^^^^^^^^^^^^^ meta.image.inline.description -| ^ punctuation.definition.image.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^^^^^^^^^^^^^^^^^ string.quoted.double -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata - Here is a ![example image](https://test.com/sublime.png 'A demonstration'). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.image.inline -| ^^ punctuation.definition.image.begin -| ^^^^^^^^^^^^^ meta.image.inline.description -| ^ punctuation.definition.image.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^^^^^^^^^^^^^^^^^ string.quoted.single -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata - Here is a ![example image](https://test.com/sublime.png (A demonstration)). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.image.inline -| ^^ punctuation.definition.image.begin -| ^^^^^^^^^^^^^ meta.image.inline.description -| ^ punctuation.definition.image.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^^^^^^^^^^^^^^^^^ string.quoted.other -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata + a.b-c_d@a.b +| <- - meta.link - markup.underline +|^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown +| ^ punctuation.separator.path.markdown +| ^ - meta.link - markup.underline.link -1) numberd item -| <- markup.list.numbered.bullet.markdown -|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown +a.b-c_d@a.b. +|^^^^^^^^^^ markup.underline.link +| ^^ - markup.underline.link - 2) numberd item -| <- markup.list.numbered.markdown -|^^ markup.list.numbered.bullet.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown + a.b-c_d@a.b- +| <- - meta.link - markup.underline +|^^^^^^^^^^^^^ - meta.link - markup.underline.link - 3) numberd item -| <- markup.list.numbered.markdown -|^ markup.list.numbered.markdown -| ^^ markup.list.numbered.bullet.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown + a.b-c_d@a.b_ +| <- - meta.link - markup.underline +|^^^^^^^^^^^^^ - meta.link - markup.underline.link - 4) numberd item -| <- markup.list.numbered.markdown -|^^ markup.list.numbered.markdown -| ^^ markup.list.numbered.bullet.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown *italic text HTML element end of italic text* | <- punctuation.definition.italic @@ -4663,38 +4839,6 @@ __test\ | ^ meta.hard-line-break constant.character.escape testing__ -- test *testing -blah* -| ^ markup.list.unnumbered meta.paragraph.list markup.italic punctuation.definition.italic.end - meta.paragraph.list meta.paragraph.list -- fgh -- *ghgh -| ^ markup.list.unnumbered meta.paragraph.list markup.italic punctuation.definition.italic.begin - meta.paragraph.list meta.paragraph.list -- fgfg -| <- markup.list.unnumbered.bullet punctuation.definition.list_item -- _test - -| <- markup.list.unnumbered meta.paragraph.list markup.italic invalid.illegal.non-terminated.bold-italic - still a list item -| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list -- * * * * * * * -| <- punctuation.definition.list_item -| ^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.separator.thematic-break - meta.paragraph.list meta.paragraph.list -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break - still a list item -| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - meta.paragraph.list meta.paragraph.list - http://spec.commonmark.org/0.27/#example-407 **foo [*bar*](/url)** | <- punctuation.definition.bold.begin @@ -4716,123 +4860,6 @@ _foo [**bar**](/url)_ | ^^ punctuation.definition.bold.end -1. Open `Command Palette` using menu item `Tools → Command Palette...` -|^ markup.list.numbered punctuation.definition.list_item -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list markup.raw.inline -2. Choose `Package Control: Install Package` - - -- a - - b - - c - - d -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - text here -| ^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - markup.raw.block - meta.paragraph.list meta.paragraph.list - - code here - | ^^^^^^^^ markup.raw.block - - - e -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - - code here - - > block quote code here -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered markup.quote markup.raw.block - - > > test -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote -| ^ markup.list.unnumbered markup.quote markup.quote punctuation.definition.blockquote - markup.raw.block - - - f -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - 1. test -| ^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item - -abc -| <- meta.paragraph - markup.list - -1. test -| ^^^^^ markup.list.numbered meta.paragraph.list - - test -|^^^^^^^^^ markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -| ^^^^^ meta.paragraph.list - - test -|^^^^^^^^^ markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -| ^^^^^ meta.paragraph.list - test -|^^^^^^^ markup.list.numbered meta.paragraph.list - ****test**** -|^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list - punctuation - - - - test -|^ punctuation.definition.list_item -| ^^^^^^^ markup.list.unnumbered meta.paragraph.list - punctuation -- - - - test -| <- punctuation.definition.list_item -| ^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - punctuation - -paragraph - - * List Item 1 - Text under Item 1 - * List Item 2 - Text under Item 2 - - * List Item 3 - Text under Item 3 -| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - markup.raw - - 1. fenced code block inside a list item -| ^ punctuation.definition.list_item - ```language -|^^^^^^^^^^^^^^^ meta.paragraph.list -| ^^^ punctuation.definition.raw.code-fence.begin -| ^^^^^^^^ constant.other.language-name -| ^^^^^^^^^^^ meta.code-fence - -|^^^^ meta.paragraph.list markup.raw.code-fence - ``` -| ^^^ punctuation.definition.raw.code-fence.end - test -| ^^^^^ meta.paragraph.list - markup.raw.code-fence - - 2. test -| ^ punctuation.definition.list_item - -Normal paragraph -| <- meta.paragraph - markup - -1. List - 1. Nested list - 2. Second item - - This line is still list item 1 -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered - markup.raw.block - -Test -| <- meta.paragraph - markup.list - -1. Test - - ```python -| ^^^ markup.list.numbered meta.code-fence punctuation.definition.raw.code-fence.begin - Test - -| <- - invalid - Test - ``` -| ^^^ punctuation.definition.raw.code-fence.end - -1. Test 2 -|^ markup.list.numbered.bullet punctuation.definition.list_item - - # TEST: CRITIC MARKUP ######################################################### This is an {++additional++} word in {++**bold**++}. From d2ffab24d0da004f15b02b41d53eb7db5d3dae80 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 20:52:48 +0100 Subject: [PATCH 23/63] Syntax: Reorganize block quote tests This commit moves existing block quote related tests to a dedicated section whose position matches the specification's chapter. --- tests/syntax_test_markdown.md | 455 +++++++++++++++++----------------- 1 file changed, 227 insertions(+), 228 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 4ddd3780..4ca1953e 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1080,182 +1080,6 @@ Fenced codeblocks are no no setext heading |^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - - -# TEST: BLOCK QUOTES ########################################################## - -> This is a block quote. It contains markup. -> Including things like *italics* -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote -| ^^^^^^^^^ markup.italic - ->= -| <- punctuation.definition.blockquote.markdown - ->== -| <- punctuation.definition.blockquote.markdown - - >= -| ^ punctuation.definition.blockquote.markdown - >= -| ^^ - punctuation.definition.blockquote.markdown - - >= -| ^^ - punctuation.definition.blockquote.markdown - -> Block quote -| <- markup.quote punctuation.definition.blockquote -| ^^^^^^^^^^^ markup.quote - -> Block quote followed by an empty block quote line -> -| <- markup.quote punctuation.definition.blockquote - -> Block quote followed by an empty block quote line -> -> Followed by more quoted text -| <- markup.quote punctuation.definition.blockquote - -> > Nested block quote -| <- markup.quote punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown -|^ - punctuation -| ^ punctuation.definition.blockquote -| ^ - punctuation - -> > Nested quote -> Followed by more quoted text that is not nested -| <- markup.quote punctuation.definition.blockquote - markup.quote markup.quote - -> Here is a block quote -This quote continues on. Line breaking is OK in markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote -> Here it is again -| <- punctuation.definition.blockquote - -paragraph -| <- meta.paragraph - -> > this is a nested quote but no code in a block quote -| <- punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown - -> > this is code in a block quote, not a nested quote -| <- punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block - markup.quote markup.quote - -> CommonMark expects following line to be indented code block (see: example 326) - > but all common parsers handle it as continued text. -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown - markup.raw -| ^ - punctuation - -> Quoted fenced code block begin -> ``` -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm -| ^^^ punctuation.definition.raw.code-fence.begin.markdown - -> Quoted fenced code block language identifier -> ```C++ -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm -| ^^^ constant.other.language-name.markdown - -> Quoted fenced code block language identifier -> ```C++ info string -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^^^^^^^^^^^^^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm -| ^^^ constant.other.language-name.markdown -| ^^^^^^^^^^^^^ - constant - -> Quoted fenced code block content -> ``` -> code block -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^^^^^^^^ markup.quote.markdown markup.raw.code-fence.markdown-gfm - -> Quoted fenced code block end -> ``` -> ``` -| <- markup.quote.markdown punctuation.definition.blockquote.markdown -|^ markup.quote.markdown - meta.code-fence -| ^^^^ markup.quote.markdown meta.code-fence.definition.end.text.markdown-gfm -| ^^^ punctuation.definition.raw.code-fence.end.markdown - -> > 2nd level quoted fenced code block -> > ``` -> > code block ``` -> > ``` -| <- markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown -|^^^ markup.quote.markdown markup.quote.markdown - meta.code-fence -| ^^^^ markup.quote.markdown markup.quote.markdown meta.code-fence.definition.end.text.markdown-gfm - -> Block quote followed by fenced code block -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown - meta.quote -``` -| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown - meta.quote - -> Quoted fenced code block is terminated by missing > at bol -> ``` -no code block -| <- meta.paragraph.markdown - meta.quote - meta.code-fence -|^^^^^^^^^^^^^ meta.paragraph.markdown - meta.quote - meta.code-fence - -> Quoted fenced code block is terminated by missing > at bol -> ``` -> content -no code block -| <- meta.paragraph.markdown - meta.quote - meta.code-fence -|^^^^^^^^^^^^^ meta.paragraph.markdown - meta.quote - meta.code-fence - -> Unterminated quoted fenced code block followed by unquoted fenced code block -> ``` -``` -| <- meta.code-fence.definition.begin.text.markdown-gfm - markup.quote -``` -| <- meta.code-fence.definition.end.text.markdown-gfm - markup.quote - -> Block quote followed by heading -# heading -| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown -|^^^^^^^^^ markup.heading.1.markdown - meta.quote -| ^^^^^^^ entity.name.section.markdown - -> Block quote followed by list -* list item -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote - -> Block quote followed by list -+ list item -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote - -> Block quote followed by list -- list item -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote - -> Block quote followed by list -1. list item -| <- markup.list.numbered.bullet.markdown - punctuation -|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^ markup.list.numbered.markdown - meta.quote - -> Block quote followed by thematic break -*** -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote - -> Block quote followed by thematic break -- - - -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote - - # TEST: INDENTED CODE BLOCKS ################################################## Code block below: @@ -2852,6 +2676,233 @@ A line with bolded **|** | ^ - punctuation.separator.table-cell +# TEST: BLOCK QUOTES ########################################################## + +> This is a block quote. It contains markup. +> Including things like *italics* +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote +| ^^^^^^^^^ markup.italic + +>= +| <- punctuation.definition.blockquote.markdown + +>== +| <- punctuation.definition.blockquote.markdown + + >= +| ^ punctuation.definition.blockquote.markdown + >= +| ^^ - punctuation.definition.blockquote.markdown + + >= +| ^^ - punctuation.definition.blockquote.markdown + +> Block quote +| <- markup.quote punctuation.definition.blockquote +| ^^^^^^^^^^^ markup.quote + +> Block quote followed by an empty block quote line +> +| <- markup.quote punctuation.definition.blockquote + +> Block quote followed by an empty block quote line +> +> Followed by more quoted text +| <- markup.quote punctuation.definition.blockquote + +> > Nested block quote +| <- markup.quote punctuation.definition.blockquote +| ^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown +|^ - punctuation +| ^ punctuation.definition.blockquote +| ^ - punctuation + +> > Nested quote +> Followed by more quoted text that is not nested +| <- markup.quote punctuation.definition.blockquote - markup.quote markup.quote + +> Here is a block quote +This quote continues on. Line breaking is OK in markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote +> Here it is again +| <- punctuation.definition.blockquote + +paragraph +| <- meta.paragraph + +> > this is a nested quote but no code in a block quote +| <- punctuation.definition.blockquote +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown + +> > this is code in a block quote, not a nested quote +| <- punctuation.definition.blockquote +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block - markup.quote markup.quote + +> CommonMark expects following line to be indented code block (see: example 326) + > but all common parsers handle it as continued text. +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown - markup.raw +| ^ - punctuation + +> Quoted fenced code block begin +> ``` +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm +| ^^^ punctuation.definition.raw.code-fence.begin.markdown + +> Quoted fenced code block language identifier +> ```C++ +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm +| ^^^ constant.other.language-name.markdown + +> Quoted fenced code block language identifier +> ```C++ info string +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^^^^^^^^^^^^^^^^ markup.quote.markdown meta.code-fence.definition.begin.text.markdown-gfm +| ^^^ constant.other.language-name.markdown +| ^^^^^^^^^^^^^ - constant + +> Quoted fenced code block content +> ``` +> code block +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^^^^^^^^ markup.quote.markdown markup.raw.code-fence.markdown-gfm + +> Quoted fenced code block end +> ``` +> ``` +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - meta.code-fence +| ^^^^ markup.quote.markdown meta.code-fence.definition.end.text.markdown-gfm +| ^^^ punctuation.definition.raw.code-fence.end.markdown + +> > 2nd level quoted fenced code block +> > ``` +> > code block ``` +> > ``` +| <- markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^ markup.quote.markdown markup.quote.markdown - meta.code-fence +| ^^^^ markup.quote.markdown markup.quote.markdown meta.code-fence.definition.end.text.markdown-gfm + +> Block quote followed by fenced code block +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown - meta.quote +``` +| <- meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown - meta.quote + +> Quoted fenced code block is terminated by missing > at bol +> ``` +no code block +| <- meta.paragraph.markdown - meta.quote - meta.code-fence +|^^^^^^^^^^^^^ meta.paragraph.markdown - meta.quote - meta.code-fence + +> Quoted fenced code block is terminated by missing > at bol +> ``` +> content +no code block +| <- meta.paragraph.markdown - meta.quote - meta.code-fence +|^^^^^^^^^^^^^ meta.paragraph.markdown - meta.quote - meta.code-fence + +> Unterminated quoted fenced code block followed by unquoted fenced code block +> ``` +``` +| <- meta.code-fence.definition.begin.text.markdown-gfm - markup.quote +``` +| <- meta.code-fence.definition.end.text.markdown-gfm - markup.quote + +> Block quote followed by heading +# heading +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^^^^ markup.heading.1.markdown - meta.quote +| ^^^^^^^ entity.name.section.markdown + +> Block quote followed by list +* list item +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote + +> Block quote followed by list ++ list item +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote + +> Block quote followed by list +- list item +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote + +> Block quote followed by list +1. list item +| <- markup.list.numbered.bullet.markdown - punctuation +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^ markup.list.numbered.markdown - meta.quote + +> Block quote followed by thematic break +*** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote + +> Block quote followed by thematic break +- - - +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote + +> Block quote with list items +> - list item 1 +| ^ markup.quote punctuation.definition.list_item +> - list item 2 +| ^ markup.list.unnumbered.bullet punctuation.definition.list_item +| ^^^^^^^^^^^^^^ markup.quote markup.list.unnumbered +| ^^^^^^^^^^^^ meta.paragraph.list +> 1. sub list item +| <- markup.quote punctuation.definition.blockquote +|^^^^^^^^^^^^^^^^^^^^ markup.quote +| ^ punctuation.definition.list_item +| ^^ markup.list.numbered.bullet +| ^^^^^^^^^^^^^^^^^^^ markup.list.numbered +| ^^^^^^^^^^^^^^ meta.paragraph.list +> - list item 3 + continued +| ^^^^^^^^^^ markup.quote.markdown markup.list.unnumbered.markdown meta.paragraph.list.markdown + +> Block quote with GFM tasks +> * [ ] task +| ^^^^^^^^^^^ markup.quote.markdown +| ^ markup.list.unnumbered.bullet.markdown +| ^^^^^^^^^^ markup.list.unnumbered.markdown +| ^ punctuation.definition.list_item.markdown +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +> * [x] task +| ^^^^^^^^^^^ markup.quote.markdown +| ^ markup.list.unnumbered.bullet.markdown +| ^^^^^^^^^^ markup.list.unnumbered.markdown +| ^ punctuation.definition.list_item.markdown +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +> * [X] task +| ^^^^^^^^^^^ markup.quote.markdown +| ^ markup.list.unnumbered.bullet.markdown +| ^^^^^^^^^^ markup.list.unnumbered.markdown +| ^ punctuation.definition.list_item.markdown +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +> * [X] task +> - [ ] task +| ^^^^^^^^^^^^^ markup.quote.markdown +| ^ markup.list.unnumbered.bullet.markdown +| ^^^^^^^^^^ markup.list.unnumbered.markdown +| ^ punctuation.definition.list_item.markdown +| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm +| ^ markup.checkbox.mark.markdown-gfm - punctuation +| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm + + # TEST: LIST BLOKCKS ########################################################## Paragraph of text that should be scoped as meta.paragraph. @@ -2975,24 +3026,6 @@ Paragraph break. ``` |^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -> Block quote with list items -> - list item 1 -| ^ markup.quote punctuation.definition.list_item -> - list item 2 -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -| ^^^^^^^^^^^^^^ markup.quote markup.list.unnumbered -| ^^^^^^^^^^^^ meta.paragraph.list -> 1. sub list item -| <- markup.quote punctuation.definition.blockquote -|^^^^^^^^^^^^^^^^^^^^ markup.quote -| ^ punctuation.definition.list_item -| ^^ markup.list.numbered.bullet -| ^^^^^^^^^^^^^^^^^^^ markup.list.numbered -| ^^^^^^^^^^^^^^ meta.paragraph.list -> - list item 3 - continued -| ^^^^^^^^^^ markup.quote.markdown markup.list.unnumbered.markdown meta.paragraph.list.markdown - * this is a list > This is a blockquote. @@ -3049,40 +3082,6 @@ Paragraph break. * list continues | ^^^^^^^^^^^^^^^ - markup.raw -> * [ ] task -| ^^^^^^^^^^^ markup.quote.markdown -| ^ markup.list.unnumbered.bullet.markdown -| ^^^^^^^^^^ markup.list.unnumbered.markdown -| ^ punctuation.definition.list_item.markdown -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -> * [x] task -| ^^^^^^^^^^^ markup.quote.markdown -| ^ markup.list.unnumbered.bullet.markdown -| ^^^^^^^^^^ markup.list.unnumbered.markdown -| ^ punctuation.definition.list_item.markdown -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -> * [X] task -| ^^^^^^^^^^^ markup.quote.markdown -| ^ markup.list.unnumbered.bullet.markdown -| ^^^^^^^^^^ markup.list.unnumbered.markdown -| ^ punctuation.definition.list_item.markdown -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm -> * [X] task -> - [ ] task -| ^^^^^^^^^^^^^ markup.quote.markdown -| ^ markup.list.unnumbered.bullet.markdown -| ^^^^^^^^^^ markup.list.unnumbered.markdown -| ^ punctuation.definition.list_item.markdown -| ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm -| ^ markup.checkbox.mark.markdown-gfm - punctuation -| ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm - * list item

*no-markdown*

From 0218bb0e9ee765f01214fb9db89fc861216fe0d3 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 13:57:19 +0100 Subject: [PATCH 24/63] Syntax: Reorganize emphasis tests This commit moves existing emphasis related tests to a dedicated section whose position matches the specification's chapter. --- tests/syntax_test_markdown.md | 2238 +++++++++++++++++---------------- 1 file changed, 1157 insertions(+), 1081 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 4ca1953e..ebe0922a 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -3501,1015 +3501,386 @@ foo | <- invalid.illegal.non-terminated.raw -# TEST: LINKS ################################################################# +# TEST: EMPHASIS ############################################################## -A [link](https://example.com){ :_attr = value }, *italic text* and **bold**. -| ^^^^^^ meta.link.inline.description.markdown -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^^^^^^^^^^ meta.attribute-with-value.markdown -| ^^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^ string.unquoted.markdown -| ^ punctuation.definition.attributes.end.markdown -| ^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^ punctuation.definition.bold -| ^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold +## https://spec.commonmark.org/0.27/#example-328 -Here is a [](https://example.com). -| ^^ meta.link.inline -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata +*foo bar* +| <- punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end -Here is a [](https://example.com){_attr="value"}. -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^^^ string.quoted.double.markdown -| ^ punctuation.definition.attributes.end.markdown +## https://spec.commonmark.org/0.27/#example-329 -Here is a [link](#with_(parens/inside)_urls). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown +This is not emphasis, because the opening `*` is followed by whitespace, and hence not part of a left-flanking delimiter run: +a * foo bar* +| ^^^^^^^^^^^ - punctuation -Here is a [link](\(foo\)). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^ markup.underline.link.markdown -| ^^ constant.character.escape.markdown -| ^^ constant.character.escape.markdown -| ^ punctuation.definition.metadata.end.markdown +## https://spec.commonmark.org/0.27/#example-332 -Here is a [link](foo\)\:). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^ markup.underline.link.markdown -| ^^ constant.character.escape.markdown -| ^ punctuation.definition.metadata.end.markdown +Intraword emphasis with `*` is permitted: +foo*bar* +| ^ punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end +## https://spec.commonmark.org/0.27/#example-333 -Here is a [link](). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^^^^ markup.underline.link.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.end.markdown +5*6*78 +|^ punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end -Here is a [link](http://example.com?foo=3#frag). -| ^^^^^^ meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown -| ^^ - meta.link -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.definition.metadata.end.markdown +## https://spec.commonmark.org/0.27/#example-334 -Not a [link] (url) due to space. -| ^^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link +_foo bar_ +| <- punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end -Here is a [reference link][name]. -| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^ meta.link.reference.metadata.markdown -| ^ punctuation.definition.link.begin.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown +## https://spec.commonmark.org/0.27/#example-335 -Here is a [reference link][name]{_attr='value' :att2}. -| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^ meta.link.reference.metadata.markdown -| ^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.attributes.markdown -| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown -| ^ - meta.attribute-with-value -| ^^^^^ meta.attribute-with-value.markdown -| ^ punctuation.definition.link.begin.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^^^ string.quoted.single.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.definition.attributes.end.markdown +This is not emphasis, because the opening `_` is followed by whitespace: +_ foo bar_ +| <- - punctuation +| ^^^^^^^^^ - punctuation -Here is a [blank reference link][]{}. -| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.literal.description.markdown -| ^^ meta.link.reference.literal.metadata.markdown -| ^^ meta.link.reference.literal.attributes.markdown -| ^ punctuation.definition.link.begin.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^ punctuation.definition.metadata.end.markdown -| ^ punctuation.definition.attributes.begin.markdown -| ^ punctuation.definition.attributes.end.markdown +## https://spec.commonmark.org/0.27/#example-336 -now you can access the [The Ever Cool Site: Documentation about Sites]( - www.thecoolsite.com.ca/documentations/about/cool ) for more information about... -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline markup.underline.link -| ^ - invalid -| ^ meta.link.inline punctuation.definition.metadata.end +This is not emphasis, because the opening `_` is preceded by an alphanumeric and followed by punctuation: +a_"foo"_ +|^^^^^^^^ - punctuation -now you can access the [The Ever Cool Site: Documentation about Sites]( - www.thecoolsite.com.ca /documentations/about/cool ) for more information about... -| ^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inline markup.underline.link -| ^ meta.paragraph meta.link.inline - markup.underline.link -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - meta.link.inline +## https://spec.commonmark.org/0.27/#example-337 -now you can access the [The Ever Cool Site: Documentation about Sites]( - www.thecoolsite.com.ca/documentations/about/cool - (title)) for more information about... -| ^^^^^^^^ meta.paragraph meta.link.inline -| ^ punctuation.definition.metadata.end -| ^^^^^^^ string.quoted.other.markdown +Emphasis with `_` is not allowed inside words: +foo_bar_ +| ^^^^^ - punctuation -link with a single underscore inside the text : [@_test](http://example.com) -| ^^^^^^ meta.paragraph meta.link.inline.description - punctuation.definition -| ^ meta.paragraph meta.link.inline punctuation.definition.link.end +## https://spec.commonmark.org/0.27/#example-338 -[foo] -|<- meta.link.reference punctuation.definition.link.begin -|^^^ meta.paragraph meta.link.reference -| ^ meta.link.reference punctuation.definition.link.end +5_6_78 +|^^^^^ - punctuation -This is literal [Foo*bar\]] but [ref][Foo*bar\]] -| ^^^^^^^^^^^ meta.link.reference.description.markdown -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^ - constant -| ^^ constant.character.escape.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^^^ meta.link.reference.metadata.markdown +## https://spec.commonmark.org/0.27/#example-339 -[**Read more →**][details] -|^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^ meta.link.reference.metadata.markdown -|^^ punctuation.definition.bold.begin.markdown -| ^^^^^^^ constant.character.entity.decimal.html -| ^^ punctuation.definition.bold.end.markdown -| ^^^^^^^ markup.underline.link.markdown +пристаням_стремятся_ +| ^^^^^^^^^^^ - punctuation -[Read more →][details] -|^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^ meta.link.reference.metadata.markdown -| ^^^^^^^ constant.character.entity.decimal.html -| ^^^^^^^ markup.underline.link +## https://spec.commonmark.org/0.27/#example-341 -[Read more ][details] -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^ meta.link.reference.metadata.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.tag -| ^^^^^^^^^^^^^^^^^^ source.css -| ^^^^^^^ constant.character.entity.decimal.html - meta.tag -| ^^^^^^^ meta.tag -| ^^^^^^^ markup.underline.link +foo-_(bar)_ +| ^ punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end -[![Cool ★ Image - Click to Enlarge][img-example]][img-example] -| <- meta.link.reference.description.markdown punctuation.definition.link.begin.markdown -|^^ meta.link.reference.description.markdown meta.image.reference.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown meta.image.reference.description.markdown -| ^^^^^^^^^^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^^^^^ meta.link.reference.metadata.markdown -|^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata.end.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.metadata.end.markdown +*foo bar * +| <- punctuation.definition.italic.begin +| ^ - punctuation +* +| <- - punctuation +abc* +| ^ punctuation.definition.italic.end -[![Cool ★ Image - Click to Enlarge](http://www.sublimetext.com/anim/rename2_packed.png)](http://www.sublimetext.com/anim/rename2_packed.png) -| <- meta.paragraph.markdown meta.link.inline.description.markdown punctuation.definition.link.begin.markdown -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inline.description.markdown meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inline.description.markdown meta.image.inline.metadata.markdown -| ^ meta.paragraph.markdown meta.link.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inline.metadata.markdown -|^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown -| ^ punctuation.definition.link.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown +## https://spec.commonmark.org/0.27/#example-347 -[link [containing] [square] brackets](#backticks) -|<- punctuation.definition.link.begin -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.link.end +*foo*bar +| <- punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end -[link `containing square] brackets] in backticks`[]](#wow) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.raw.begin -| ^ punctuation.definition.raw.end -| ^ punctuation.definition.link.end +## https://spec.commonmark.org/0.27/#example-348 -[link ``containing square]` brackets[[][] in backticks``](#wow) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.inline -| ^^ punctuation.definition.raw.begin -| ^^ punctuation.definition.raw.end -| ^ punctuation.definition.link.end +_foo bar _ +| <- punctuation.definition.italic.begin +| ^ - punctuation +_ +| <- - punctuation +abc_ +| ^ punctuation.definition.italic.end -This is a [reference] () -| ^^^^^^^^^^^ meta.link.reference -| ^^^^ - meta.link +## https://spec.commonmark.org/0.27/#example-351 -This is a [reference] (followed by parens) -| ^^^^^^^^^^^ meta.link.reference -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link +Intraword emphasis is disallowed for `_`: +_foo_bar +| <- punctuation.definition.italic.begin +| ^ - punctuation +abc_ +| ^ punctuation.definition.italic.end -This is a [reference] [] -| ^^^^^^^^^^^ meta.link.reference -| ^ - meta.link -| ^^ meta.link.reference +## https://spec.commonmark.org/0.27/#example-353 -This is a ![reference] () -| ^^^^^^^^^^^^^^^ - meta.image -| ^^^^^^^^^^^ meta.link.reference -| ^^^^ - meta.link +_foo_bar_baz_ +| <- punctuation.definition.italic.begin +| ^^^^^ - punctuation +| ^ punctuation.definition.italic.end -This is a ![reference] (followed by parens) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.image -| ^^^^^^^^^^^ meta.link.reference -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link +## https://spec.commonmark.org/0.27/#example-354 -This is a ![reference] [] -| ^^^^^^^^^^^^^^^ - meta.image -| ^^^^^^^^^^^ meta.link.reference -| ^ - meta.link -| ^^ meta.link.reference +_(bar)_. +| <- punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end +## https://spec.commonmark.org/0.27/#example-355 -# TEST: IMAGES ################################################################ + **foo bar** +|^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end -Here is a ![](https://example.com/cat.gif). -| ^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown +## https://spec.commonmark.org/0.27/#example-356 -Here is a ![](https://example.com/cat.gif){_at"r=value :att2}. -| ^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^^^^^^^^^^^^^^^^^^ meta.image.inline.attributes.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata -| ^ punctuation.definition.attributes.begin.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ invalid.illegal.attribute-name.markdown -| ^ punctuation.separator.key-value.markdown -| ^^^^^ string.unquoted.markdown -| ^^^^^ entity.other.attribute-name.markdown -| ^ punctuation.definition.attributes.end.markdown +** foo bar** +| <- - punctuation +| ^^ - punctuation -Here is a ![Image Alt Text](https://example.com/cat.gif). -| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown +## https://spec.commonmark.org/0.27/#example-358 -Here is a ![Image Alt Text]( https://example.com/cat.gif ). -| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown -| ^^ - meta.image -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end - string -| ^ punctuation.definition.metadata.begin.markdown -| ^^ - markup.underline -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^^ - markup.underline -| ^ punctuation.definition.metadata.end.markdown +foo**bar** +| ^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end -Here is a ![Image Alt Text]( - https://example.com/cat.gif ). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown +## https://spec.commonmark.org/0.27/#example-359 -Here is a ![Image Alt Text]( - https://example.com/cat.gif - "hello" ). -|^^^^^^^ meta.image.inline string.quoted.double -| ^^^^ meta.image.inline -| ^ punctuation.definition.metadata.end + __foo bar__ +|^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end -Here is a ![Image Alt Text]( - "hello" ). -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown -| ^^ meta.paragraph.markdown - meta.image -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^^^ string.quoted.double.markdown -| ^ punctuation.definition.string.begin.markdown -| ^ punctuation.definition.string.end.markdown -| ^ punctuation.definition.metadata.end.markdown +## https://spec.commonmark.org/0.27/#example-360 -Here is a ![Image Alt Text]( - (hello) ). -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown -| ^^ meta.paragraph.markdown - meta.image -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^^^ string.quoted.other.markdown -| ^ punctuation.definition.string.begin.markdown -| ^ punctuation.definition.string.end.markdown -| ^ punctuation.definition.metadata.end.markdown +This is not strong emphasis, because the opening delimiter is followed by whitespace: +__ foo bar__ +| <- - punctuation +| ^^ - punctuation -Here is a ![Image Alt Text]( - https://example .com /cat.gif (hello) ). -|^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline -| ^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown markup.underline.link.image.markdown -| ^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.image - markup.underline +## https://spec.commonmark.org/0.27/#example-361 -Here is a ![Image Ref Alt][1]. -| ^^^^^^^^^^^^^^^^ meta.image.reference.description.markdown -| ^^^ meta.image.reference.metadata.markdown -| ^^ punctuation.definition.image.begin.markdown -| ^ punctuation.definition.image.end.markdown -| ^ punctuation.definition.metadata.begin.markdown -| ^ markup.underline.link.markdown -| ^ punctuation.definition.metadata.end.markdown +__ +| <- - punctuation +## https://spec.commonmark.org/0.27/#example-362 -# TEST: FOOTNOTES ############################################################# +a__"foo"__ +|^^^^^^^^^ - punctuation +## https://spec.commonmark.org/0.27/#example-363 -## https://michelf.ca/projects/php-markdown/extra/#footnotes +Intraword strong emphasis is forbidden with `__`: +foo__bar__ +| ^^^^^^^ - punctuation -That's some text with a footnote.[^1] -| ^^^^ meta.paragraph meta.link.reference.footnote.markdown-extra -| ^ punctuation.definition.link.begin -| ^^ meta.link.reference.literal.footnote-id -| ^ punctuation.definition.link.end +## https://spec.commonmark.org/0.27/#example-364 -Here is a footnote[^1][link][] or long[^longnote][link][]. -| ^^^^ meta.link.reference.footnote.markdown-extra -| ^^^^^^ meta.link.reference.literal.description.markdown -| ^^ meta.link.reference.literal.metadata.markdown -| ^^^^^^^^^^^ meta.link.reference.footnote.markdown-extra -| ^^^^^^^^ meta.link.reference.literal +5__6__78 +|^^^^^^^ - punctuation -Here is a footnote [^footnote](not_link_dest). -| ^^^^^^^^^^^ meta.paragraph.markdown meta.link.reference.footnote.markdown-extra -| ^ punctuation.definition.link.begin.markdown -| ^^^^^^^^^ meta.link.reference.literal.footnote-id.markdown -| ^ punctuation.definition.link.end.markdown -| ^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.link +## https://spec.commonmark.org/0.27/#example-367 +foo-__(bar)__ +| ^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end -# TEST: COMMONMARK AUTOLINKS ################################################## +## https://spec.commonmark.org/0.27/#example-368 - -| <- meta.link.email.markdown punctuation.definition.link.begin.markdown - markup.underline -|^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -| ^ meta.link.email.markdown - markup.underline -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.definition.link.end.markdown +**foo bar ** +| <- punctuation.definition.bold.begin +| ^^ - punctuation +abc** +| ^^ punctuation.definition.bold.end - -| <- meta.link.email.markdown punctuation.definition.link.begin.markdown - markup.underline -|^^^^^^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -| ^ meta.link.email.markdown - markup.underline -| ^ punctuation.separator.path.markdown -| ^ punctuation.definition.link.end.markdown +## https://spec.commonmark.org/0.27/#example-373 - -| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown - markup.underline -|^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown -| ^ meta.link.inet.markdown - markup.underline -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.definition.link.end.markdown +Intraword emphasis: + **foo**bar +|^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end - -| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown - markup.underline -|^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown -| ^ meta.link.inet.markdown - markup.underline -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.definition.link.end.markdown +## https://spec.commonmark.org/0.27/#example-374 - -| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown - markup.underline -|^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown -| ^ meta.link.inet.markdown - markup.underline -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.definition.link.end.markdown + __foo bar __ +|^^ punctuation.definition.bold.begin +| ^^ - punctuation +abc__ +| ^^ punctuation.definition.bold.end - -| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown - markup.underline -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown -| ^ meta.link.inet.markdown - markup.underline -| ^^^ punctuation.separator.path.markdown -| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown -| ^^ constant.character.escape.url.markdown - punctuation -| ^ punctuation.separator.path.markdown +## https://spec.commonmark.org/0.27/#example-376 - -| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown -|^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown -| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown +_(__foo__)_ +| <- punctuation.definition.italic.begin +| ^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end +| ^ punctuation.definition.italic.end - -| <- meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.begin.markdown -|^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inet.markdown markup.underline.link.markdown -| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown -| ^^^ punctuation.separator.path.markdown +## https://spec.commonmark.org/0.27/#example-377 - -| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown -|^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown -| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown +Intraword strong emphasis is forbidden with `__`: +__foo__bar +| <- punctuation.definition.bold.begin +| ^^ - punctuation +abc__ +| ^^ punctuation.definition.bold.end - -| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown -|^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown -| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown +## https://spec.commonmark.org/0.27/#example-379 - -| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown -|^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown -| ^^^^^^ - meta.link -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown +__foo__bar__baz__ +| <- punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end +| ^^^^^^^^^^ - punctuation - -| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown -|^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown -| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown +## https://spec.commonmark.org/0.27/#example-380 +This is strong emphasis, even though the closing delimiter is both left- and right-flanking, because it is followed by punctuation: +__(bar)__. +| <- punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end -# TEST: GFM AUTOLINKS ######################################################### +## https://spec.commonmark.org/0.27/#example-381 -Visit ftp://intra%20net -| ^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^^^ punctuation.separator.path.markdown -| ^ - constant -| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown -| ^^ constant.character.escape.url.markdown - punctuation -| ^^^ - constant +*foo [bar](/url)* +| <- punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end +| ^^^^^^^^^^^ meta.link.inline -Visit http://intra%20net -| ^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^^^ punctuation.separator.path.markdown -| ^ - constant -| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown -| ^^ constant.character.escape.url.markdown - punctuation -| ^^^ - constant +## https://spec.commonmark.org/0.27/#example-382 -Visit https://intra%20net -| ^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^^^ punctuation.separator.path.markdown -| ^ - constant -| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown -| ^^ constant.character.escape.url.markdown - punctuation -| ^^^ - constant +*foo +| <- punctuation.definition.italic.begin +bar* +| ^ punctuation.definition.italic.end -Visit www.intra%20net -| ^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ - constant -| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown -| ^^ constant.character.escape.url.markdown - punctuation -| ^^^ - constant +## https://spec.commonmark.org/0.27/#example-383 -Visit www.commonmark.org/help for more information. -| ^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^ - markup.underline.link +_foo __bar__ baz_ +| <- punctuation.definition.italic.begin +| ^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end +| ^ punctuation.definition.italic.end -Visit www.commonmark.org. -| ^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inet.markdown markup.underline.link -| ^^ - markup.underline.link +## https://spec.commonmark.org/0.27/#example-394 -Visit www.commonmark.org/a.b. -| ^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inet.markdown markup.underline.link -| ^ - markup.underline.link -| ^ punctuation.separator.path.markdown +** is not an empty emphasis +| <- - punctuation +|^ - punctuation -www.google.com/search?q=(business))+ok -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ - markup.underline.link +## https://spec.commonmark.org/0.27/#example-395 -www.google.com/search?q=Markup+(business) -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown +**** is not an empty strong emphasis +| <- - punctuation +|^^^ - punctuation -www.commonmark.org/he -|^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^ - markup.underline.link +## https://spec.commonmark.org/0.27/#example-396 -http://commonmark.org -|^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^^^ punctuation.separator.path.markdown +**foo [bar](/url)** +| <- punctuation.definition.bold.begin +| ^^^^^^^^^^^ meta.link.inline +| ^^ punctuation.definition.bold.end -www.google.com/search?q=commonmark&hl=en -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ - markup.underline.link +## https://spec.commonmark.org/0.27/#example-397 -www.google.com/search?q=commonmark&hl; -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^^^^ constant.character.entity.named.html - markup.underline.link +**foo +| <- punctuation.definition.bold.begin +bar** +| ^^ punctuation.definition.bold.end -www.google.com/search?q=commonmark&hl;&hl; -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^^^^^^^^ constant.character.entity.named.html - markup.underline.link +## https://spec.commonmark.org/0.27/#example-398 -www.google.com/search?q=commonmark&hl;! -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^^^^^^ - meta.link -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^^^^ constant.character.entity.named.html - markup.underline.link +__foo _bar_ baz__ +| <- punctuation.definition.bold.begin +| ^ punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end +| ^^ punctuation.definition.bold.end -www.google.com/search?q=commonmark&hl;f -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ - meta.link -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^^^^ - constant.character +## https://spec.commonmark.org/0.27/#example-408 -(Visit https://encrypted.google.com/search?q=Markup+(business)) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^^ - markup.underline.link +__ is not an empty emphasis +| <- - punctuation +|^ - punctuation -Anonymous FTP is available at ftp://foo.bar.baz. -| ^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^^^ punctuation.separator.path.markdown -| ^^ - markup.underline.link +## https://spec.commonmark.org/0.27/#example-409 -(see http://www.google.com/search?q=commonmark&hl=en) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^^^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown -| ^^ - markup.underline.link +____ is not an empty strong emphasis +| <- - punctuation +|^^^ - punctuation -foo@bar.baz -| <- meta.link.email.markdown markup.underline.link.markdown -|^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -| ^ punctuation.separator.path.markdown -| ^ - meta.link - markup.underline.link -hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.link - markup.underline.link -| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown +## https://spec.commonmark.org/0.27/#example-410 - test@test.test.me -| <- - meta.link - markup.underline -|^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -| ^ punctuation.separator.path.markdown -| ^ - meta.link - markup.underline.link +foo *** +| ^^^ - punctuation - a.b-c_d@a.b -| <- - meta.link - markup.underline -|^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -| ^ punctuation.separator.path.markdown -| ^ - meta.link - markup.underline.link +## https://spec.commonmark.org/0.27/#example-411 -a.b-c_d@a.b. -|^^^^^^^^^^ markup.underline.link -| ^^ - markup.underline.link +foo *\** +| ^ punctuation.definition.italic.begin +| ^^ constant.character.escape +| ^ punctuation.definition.italic.end - a.b-c_d@a.b- -| <- - meta.link - markup.underline -|^^^^^^^^^^^^^ - meta.link - markup.underline.link +## https://spec.commonmark.org/0.27/#example-412 - a.b-c_d@a.b_ -| <- - meta.link - markup.underline -|^^^^^^^^^^^^^ - meta.link - markup.underline.link +foo *_* +| ^ punctuation.definition.italic.begin +| ^ - punctuation +| ^ punctuation.definition.italic.end +## https://spec.commonmark.org/0.27/#example-414 -*italic text HTML element end of italic text* -| <- punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +foo **\*** +| ^^ punctuation.definition.bold.begin +| ^^ constant.character.escape +| ^^ punctuation.definition.bold.end -_italic text HTML element end of italic text_ -| <- punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +## https://spec.commonmark.org/0.27/#example-415 -**bold text HTML element end of bold text** -| <- punctuation.definition.bold -| ^^ punctuation.definition.bold -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +foo **_** +| ^^ punctuation.definition.bold.begin +| ^ - punctuation +| ^^ punctuation.definition.bold.end -__bold text HTML element end of bold text__ -| <- punctuation.definition.bold -| ^^ punctuation.definition.bold -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +## https://spec.commonmark.org/0.27/#example-422 -*italic text HTML element end of italic text* -| <- punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +foo ___ +| ^^^^ - punctuation -_italic text HTML element end of italic text_ -| <- punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +## https://spec.commonmark.org/0.27/#example-423 -http://spec.commonmark.org/0.27/#example-328 -*foo bar* -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-329 -This is not emphasis, because the opening `*` is followed by whitespace, and hence not part of a left-flanking delimiter run: -a * foo bar* -| ^^^^^^^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-332 -Intraword emphasis with `*` is permitted: -foo*bar* -| ^ punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end -http://spec.commonmark.org/0.27/#example-333 -5*6*78 -|^ punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-334 -_foo bar_ -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-335 -This is not emphasis, because the opening `_` is followed by whitespace: -_ foo bar_ -| <- - punctuation -| ^^^^^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-336 -This is not emphasis, because the opening `_` is preceded by an alphanumeric and followed by punctuation: -a_"foo"_ -|^^^^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-337 -Emphasis with `_` is not allowed inside words: -foo_bar_ -| ^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-338 -5_6_78 -|^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-339 -пристаням_стремятся_ -| ^^^^^^^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-341 -foo-_(bar)_ -| ^ punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end - -*foo bar * -| <- punctuation.definition.italic.begin -| ^ - punctuation -* -| <- - punctuation -abc* -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-347 -*foo*bar -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-348 -_foo bar _ -| <- punctuation.definition.italic.begin -| ^ - punctuation -_ -| <- - punctuation -abc_ -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-351 -Intraword emphasis is disallowed for `_`: -_foo_bar -| <- punctuation.definition.italic.begin -| ^ - punctuation -abc_ -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-353 -_foo_bar_baz_ -| <- punctuation.definition.italic.begin -| ^^^^^ - punctuation -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-354 -_(bar)_. -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-355 - **foo bar** -|^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-356 -** foo bar** -| <- - punctuation -| ^^ - punctuation - -http://spec.commonmark.org/0.27/#example-358 -foo**bar** -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-359 - __foo bar__ -|^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-360 -This is not strong emphasis, because the opening delimiter is followed by whitespace: -__ foo bar__ -| <- - punctuation -| ^^ - punctuation - -http://spec.commonmark.org/0.27/#example-361 -__ -| <- - punctuation - -http://spec.commonmark.org/0.27/#example-362 -a__"foo"__ -|^^^^^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-363 -Intraword strong emphasis is forbidden with `__`: -foo__bar__ -| ^^^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-364 -5__6__78 -|^^^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-367 -foo-__(bar)__ -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-368 -**foo bar ** -| <- punctuation.definition.bold.begin -| ^^ - punctuation -abc** -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-373 -Intraword emphasis: - **foo**bar -|^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-374 - __foo bar __ -|^^ punctuation.definition.bold.begin -| ^^ - punctuation -abc__ -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-376 -_(__foo__)_ -| <- punctuation.definition.italic.begin -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-377 -Intraword strong emphasis is forbidden with `__`: -__foo__bar -| <- punctuation.definition.bold.begin -| ^^ - punctuation -abc__ -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-379 -__foo__bar__baz__ -| <- punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end -| ^^^^^^^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-380 -This is strong emphasis, even though the closing delimiter is both left- and right-flanking, because it is followed by punctuation: -__(bar)__. -| <- punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-381 -*foo [bar](/url)* -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end -| ^^^^^^^^^^^ meta.link.inline - -http://spec.commonmark.org/0.27/#example-382 -*foo -| <- punctuation.definition.italic.begin -bar* -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-383 -_foo __bar__ baz_ -| <- punctuation.definition.italic.begin -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-394 -** is not an empty emphasis -| <- - punctuation -|^ - punctuation - -http://spec.commonmark.org/0.27/#example-395 -**** is not an empty strong emphasis -| <- - punctuation -|^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-396 -**foo [bar](/url)** -| <- punctuation.definition.bold.begin -| ^^^^^^^^^^^ meta.link.inline -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-397 -**foo -| <- punctuation.definition.bold.begin -bar** -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-398 -__foo _bar_ baz__ -| <- punctuation.definition.bold.begin -| ^ punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-408 -__ is not an empty emphasis -| <- - punctuation -|^ - punctuation - -http://spec.commonmark.org/0.27/#example-409 -____ is not an empty strong emphasis -| <- - punctuation -|^^^ - punctuation - - -http://spec.commonmark.org/0.27/#example-410 -foo *** -| ^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-411 -foo *\** -| ^ punctuation.definition.italic.begin -| ^^ constant.character.escape -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-412 -foo *_* -| ^ punctuation.definition.italic.begin -| ^ - punctuation -| ^ punctuation.definition.italic.end - -http://spec.commonmark.org/0.27/#example-414 -foo **\*** -| ^^ punctuation.definition.bold.begin -| ^^ constant.character.escape -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-415 -foo **_** -| ^^ punctuation.definition.bold.begin -| ^ - punctuation -| ^^ punctuation.definition.bold.end - -http://spec.commonmark.org/0.27/#example-422 -foo ___ -| ^^^^ - punctuation - -http://spec.commonmark.org/0.27/#example-423 foo _\__ | ^ punctuation.definition.italic.begin | ^^ constant.character.escape | ^ punctuation.definition.italic.end -http://spec.commonmark.org/0.27/#example-424 +## https://spec.commonmark.org/0.27/#example-424 + foo _*_ | ^ punctuation.definition.italic.begin | ^ - punctuation | ^ punctuation.definition.italic.end -http://spec.commonmark.org/0.27/#example-426 +## https://spec.commonmark.org/0.27/#example-426 + foo __\___ | ^^ punctuation.definition.bold.begin | ^^ constant.character.escape | ^^ punctuation.definition.bold.end -http://spec.commonmark.org/0.27/#example-427 +## https://spec.commonmark.org/0.27/#example-427 + foo __*__ | ^^ punctuation.definition.bold.begin | ^ - punctuation | ^^ punctuation.definition.bold.end -This text is _bold_, but this__text__is neither bold_nor_italic +This text is _italic_, but this__text__is neither bold_nor_italic | ^ punctuation.definition.italic -| ^^^^ markup.italic -| ^ punctuation.definition.italic -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - markup.bold - markup.italic +| ^^^^^^ markup.italic +| ^ punctuation.definition.italic +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - markup.bold - markup.italic the following is italic *and doesn't end here * but does end here* | ^ punctuation.definition.italic.begin | ^ - punctuation.definition.italic | ^ punctuation.definition.italic.end + the following is bold **and doesn't end here ** but does end here** | ^^ punctuation.definition.bold.begin | ^^ - punctuation.definition.bold | ^^ punctuation.definition.bold.end + the following is not bold ** test **** | ^^ - punctuation.definition.bold.begin | ^^^^ - punctuation.definition.bold + the following is not italic _ test ____ | ^ - punctuation.definition.italic.begin | ^^^^ - punctuation.definition.italic @@ -4518,84 +3889,49 @@ more **tests *** ** here** | ^^ punctuation.definition.bold.begin | ^^^^^^ - punctuation.definition | ^^ punctuation.definition.bold.end + more __tests *** ** example __ here__ | ^^ punctuation.definition.bold.begin | ^^^^^^^^^^^^^^^^^^^^^^ - punctuation.definition | ^^ punctuation.definition.bold.end + more _tests here_ | ^ punctuation.definition.italic.begin | ^ - punctuation.definition | ^ punctuation.definition.italic.end + more _tests _here_ | ^ punctuation.definition.italic.begin | ^ - punctuation.definition | ^ - punctuation | ^ punctuation.definition.italic.end + _more `tests_` here_ | <- punctuation.definition.italic.begin | ^^^^^^^^ markup.raw.inline | ^ punctuation.definition.italic.end + __more `tests__` here__ | <- punctuation.definition.bold.begin | ^^^^^^^^^ markup.raw.inline | ^^ punctuation.definition.bold.end + **more `tests__` here** | <- punctuation.definition.bold.begin | ^^^^^^^^^ markup.raw.inline | ^^ punctuation.definition.bold.end + **more `tests**` here** | <- punctuation.definition.bold.begin | ^^^^^^^^^ markup.raw.inline | ^^ punctuation.definition.bold.end + *more `tests__` here** | <- punctuation.definition.italic.begin | ^^ - punctuation abc* | ^ punctuation.definition.italic.end -_test text_ foobar -| <- punctuation -| ^ punctuation.definition.italic.end -__test text__ not formatted -| <- punctuation -| ^^ punctuation.definition.bold.end -*test text* not formatted -| <- punctuation -| ^ punctuation.definition.italic.end -**test text** not formatted -| <- punctuation -| ^^ punctuation.definition.bold.end -_test text **formatted**_ -| <- punctuation -| ^^ punctuation -| ^^ punctuation -| ^ punctuation -*test text __formatted__* -| <- punctuation -| ^^ punctuation -| ^^ punctuation -| ^ punctuation -*test text __formatted__* **more** _text_ -| <- punctuation -| ^^ punctuation -| ^^ punctuation -| ^ punctuation -| ^^ punctuation -| ^^ punctuation -| ^ punctuation -| ^ punctuation -*test text* __formatted__ -| <- punctuation -| ^ punctuation -| ^^ punctuation -| ^^ punctuation - -__test text__ *formatted* -| <- punctuation -| ^^ punctuation -| ^ punctuation -| ^ punctuation - This is ***bold italic*** | ^^^^^^^^^^^^^^^^^ markup.bold | ^^ punctuation.definition.bold.begin @@ -4657,138 +3993,926 @@ This is ___bold italic_ and just bold__ | ^^^^^^^^^^^^^^^^ - markup.italic | ^^ punctuation.definition.bold.end -The next scope overlap funny because we have to pick one order -to scope three indicators in a row -This is ___bold italic__ and just italic_ -| ^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.begin -| ^^ punctuation.definition.bold.end -| ^^^^^^^^^^^^^^^^^ - markup.bold -| ^ punctuation.definition.italic.end +The next scope overlap funny because we have to pick one order +to scope three indicators in a row +This is ___bold italic__ and just italic_ +| ^^^^^^^^^^^^^^^ markup.bold +| ^^ punctuation.definition.bold.begin +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.italic +| ^ punctuation.definition.italic.begin +| ^^ punctuation.definition.bold.end +| ^^^^^^^^^^^^^^^^^ - markup.bold +| ^ punctuation.definition.italic.end + +This is _**italic bold**_ +| ^^^^^^^^^^^^^^^^^ markup.italic +| ^ punctuation.definition.italic.begin +| ^^^^^^^^^^^^^^^ markup.bold +| ^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end +| ^ punctuation.definition.italic.end + +This is *__italic bold__* +| ^^^^^^^^^^^^^^^^^ markup.italic +| ^ punctuation.definition.italic.begin +| ^^^^^^^^^^^^^^^ markup.bold +| ^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end +| ^ punctuation.definition.italic.end + +**test!_test** Issue 1163 +|^^^^^^^^^^^^^ markup.bold +| ^ - punctuation.definition.italic +| ^^ punctuation.definition.bold.end + +__test!*test__ Issue 1163 +|^^^^^^^^^^^^^ markup.bold +| ^ - punctuation.definition.italic +| ^^ punctuation.definition.bold.end + +*test + +| <- invalid.illegal.non-terminated.bold-italic +abc* +| ^ - punctuation + +_test + +| <- invalid.illegal.non-terminated.bold-italic +abc_ +| ^ - punctuation + +**test + +| <- invalid.illegal.non-terminated.bold-italic +abc** +| ^^ - punctuation + +__test + +| <- invalid.illegal.non-terminated.bold-italic +abc__ +| ^^ - punctuation + +__test\ +| ^ meta.hard-line-break constant.character.escape +testing__ + +## https://spec.commonmark.org/0.27/#example-407 + + +**foo [*bar*](/url)** +| <- punctuation.definition.bold.begin +| ^^^^^^^^^^^^^ markup.bold meta.link.inline +| ^^ punctuation.definition.bold.end +| ^ punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end + +**foo [_bar_](/url)** +| <- punctuation.definition.bold.begin +| ^^^^^^^^^^^^^ markup.bold meta.link.inline +| ^^ punctuation.definition.bold.end +| ^ punctuation.definition.italic.begin +| ^ punctuation.definition.italic.end + +_foo [**bar**](/url)_ +| <- punctuation.definition.italic.begin +| ^^^^^^^^^^^^^^^ markup.italic meta.link.inline +| ^ punctuation.definition.italic.end +| ^^ punctuation.definition.bold.begin +| ^^ punctuation.definition.bold.end + +*italic text HTML element end of italic text* +| <- punctuation.definition.italic +| ^ punctuation.definition.italic +| ^^^^^^ meta.tag.inline.any.html +| ^^^^^^^ meta.tag.inline.any.html + +_italic text HTML element end of italic text_ +| <- punctuation.definition.italic +| ^ punctuation.definition.italic +| ^^^^^^ meta.tag.inline.any.html +| ^^^^^^^ meta.tag.inline.any.html + +**bold text HTML element end of bold text** +| <- punctuation.definition.bold +| ^^ punctuation.definition.bold +| ^^^^^^ meta.tag.inline.any.html +| ^^^^^^^ meta.tag.inline.any.html + +__bold text HTML element end of bold text__ +| <- punctuation.definition.bold +| ^^ punctuation.definition.bold +| ^^^^^^ meta.tag.inline.any.html +| ^^^^^^^ meta.tag.inline.any.html + +*italic text HTML element end of italic text* +| <- punctuation.definition.italic +| ^ punctuation.definition.italic +| ^^^^^^ meta.tag.inline.any.html +| ^^^^^^^ meta.tag.inline.any.html + +_italic text HTML element end of italic text_ +| <- punctuation.definition.italic +| ^ punctuation.definition.italic +| ^^^^^^ meta.tag.inline.any.html +| ^^^^^^^ meta.tag.inline.any.html + +_test text_ foobar +| <- punctuation +| ^ punctuation.definition.italic.end + +__test text__ not formatted +| <- punctuation +| ^^ punctuation.definition.bold.end + +*test text* not formatted +| <- punctuation +| ^ punctuation.definition.italic.end + +**test text** not formatted +| <- punctuation +| ^^ punctuation.definition.bold.end + +_test text **formatted**_ +| <- punctuation +| ^^ punctuation +| ^^ punctuation +| ^ punctuation + +*test text __formatted__* +| <- punctuation +| ^^ punctuation +| ^^ punctuation +| ^ punctuation + +*test text __formatted__* **more** _text_ +| <- punctuation +| ^^ punctuation +| ^^ punctuation +| ^ punctuation +| ^^ punctuation +| ^^ punctuation +| ^ punctuation +| ^ punctuation + +*test text* __formatted__ +| <- punctuation +| ^ punctuation +| ^^ punctuation +| ^^ punctuation + +__test text__ *formatted* +| <- punctuation +| ^^ punctuation +| ^ punctuation +| ^ punctuation + +# TEST: STRIKETHROUGH ######################################################### + +__~~bold striked~~__ +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.strikethrough +| ^^^^^^^^^^^^^^^^ markup.bold.markdown markup.strikethrough.markdown-gfm +| ^^ markup.bold.markdown - markup.strikethrough +|^ punctuation.definition.bold.begin.markdown +| ^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^^ punctuation.definition.bold.end.markdown + +**~~bold striked~~** +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.strikethrough +| ^^^^^^^^^^^^^^^^ markup.bold.markdown markup.strikethrough.markdown-gfm +| ^^ markup.bold.markdown - markup.strikethrough +|^ punctuation.definition.bold.begin.markdown +| ^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^^ punctuation.definition.bold.end.markdown + +_~~italic striked~~_ +| <- markup.italic.markdown punctuation.definition.italic.begin.markdown +|^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.strikethrough.markdown-gfm +| ^ markup.italic.markdown - markup.strikethrough +|^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^ punctuation.definition.italic.end.markdown + +*~~italic striked~~* +| <- markup.italic.markdown punctuation.definition.italic.begin.markdown +|^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.strikethrough.markdown-gfm +| ^ markup.italic.markdown - markup.strikethrough +|^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^ punctuation.definition.italic.end.markdown + +___~~bold italic striked~~___ +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.italic - markup.strikethrough +| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough +| ^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.strikethrough.markdown-gfm +| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough +| ^^ markup.bold.markdown - markup.italic - markup.strikethrough +|^ punctuation.definition.bold.begin.markdown +| ^ punctuation.definition.italic.begin.markdown +| ^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^ punctuation.definition.italic.end.markdown +| ^^ punctuation.definition.bold.end.markdown + +***~~bold italic striked~~*** +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.italic - markup.strikethrough +| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough +| ^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.strikethrough.markdown-gfm +| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough +| ^^ markup.bold.markdown - markup.italic - markup.strikethrough +|^ punctuation.definition.bold.begin.markdown +| ^ punctuation.definition.italic.begin.markdown +| ^^ punctuation.definition.strikethrough.begin.markdown +| ^^ punctuation.definition.strikethrough.end.markdown +| ^ punctuation.definition.italic.end.markdown +| ^^ punctuation.definition.bold.end.markdown + +~Hi~ Hello, world! +| <- - punctuation.definition.strikethrough +|^^^^^^^^^^^^^^^^^ meta.paragraph - markup +| ^ - punctuation.definition.strikethrough + +This ~text~~~~ is ~~~~curious~. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - markup +| ^ - punctuation.definition.strikethrough +| ^^^^ - punctuation.definition.strikethrough +| ^^^^ - punctuation.definition.strikethrough +| ^ - punctuation.definition.strikethrough + +This ~~text~~~~ is ~~~~curious~~. +|^^^^ meta.paragraph - markup +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph markup.strikethrough +| ^^ meta.paragraph - markup +| ^^ punctuation.definition.strikethrough.begin +| ^^^^ - punctuation.definition.strikethrough +| ^^^^ - punctuation.definition.strikethrough +| ^^ punctuation.definition.strikethrough.end + +This ~~has a +| ^^^^^^^^ meta.paragraph markup.strikethrough + +| <- meta.paragraph markup.strikethrough invalid.illegal.non-terminated.bold-italic +new paragraph~~. +| ^^ meta.paragraph markup.strikethrough punctuation.definition.strikethrough.begin + +| <- invalid.illegal.non-terminated.bold-italic + + +# TEST: LINKS ################################################################# + +A [link](https://example.com){ :_attr = value }, *italic text* and **bold**. +| ^^^^^^ meta.link.inline.description.markdown +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^^^^^^^^^^ meta.attribute-with-value.markdown +| ^^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^ string.unquoted.markdown +| ^ punctuation.definition.attributes.end.markdown +| ^^^^^^^^^^^^^ markup.italic +| ^ punctuation.definition.italic +| ^ punctuation.definition.italic +| ^^ punctuation.definition.bold +| ^^^^^^^^ markup.bold +| ^^ punctuation.definition.bold + +Here is a [](https://example.com). +| ^^ meta.link.inline +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata + +Here is a [](https://example.com){_attr="value"}. +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline +| ^ punctuation.definition.link.begin +| ^ punctuation.definition.link.end +| ^ punctuation.definition.metadata +| ^^^^^^^^^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^^^ string.quoted.double.markdown +| ^ punctuation.definition.attributes.end.markdown + +Here is a [link](#with_(parens/inside)_urls). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a [link](\(foo\)). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^ markup.underline.link.markdown +| ^^ constant.character.escape.markdown +| ^^ constant.character.escape.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a [link](foo\)\:). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^ markup.underline.link.markdown +| ^^ constant.character.escape.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a [link](). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^^^^ markup.underline.link.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a [link](http://example.com?foo=3#frag). +| ^^^^^^ meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.metadata.markdown +| ^^ - meta.link +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.definition.metadata.end.markdown + +Not a [link] (url) due to space. +| ^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^ - meta.link + +Here is a [reference link][name]. +| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^ meta.link.reference.metadata.markdown +| ^ punctuation.definition.link.begin.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a [reference link][name]{_attr='value' :att2}. +| ^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^ meta.link.reference.metadata.markdown +| ^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.attributes.markdown +| ^^^^^^^^^^^^^ meta.attribute-with-value.markdown +| ^ - meta.attribute-with-value +| ^^^^^ meta.attribute-with-value.markdown +| ^ punctuation.definition.link.begin.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^^^ string.quoted.single.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.definition.attributes.end.markdown + +Here is a [blank reference link][]{}. +| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.literal.description.markdown +| ^^ meta.link.reference.literal.metadata.markdown +| ^^ meta.link.reference.literal.attributes.markdown +| ^ punctuation.definition.link.begin.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.attributes.begin.markdown +| ^ punctuation.definition.attributes.end.markdown + +now you can access the [The Ever Cool Site: Documentation about Sites]( + www.thecoolsite.com.ca/documentations/about/cool ) for more information about... +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline markup.underline.link +| ^ - invalid +| ^ meta.link.inline punctuation.definition.metadata.end + +now you can access the [The Ever Cool Site: Documentation about Sites]( + www.thecoolsite.com.ca /documentations/about/cool ) for more information about... +| ^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inline markup.underline.link +| ^ meta.paragraph meta.link.inline - markup.underline.link +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - meta.link.inline + +now you can access the [The Ever Cool Site: Documentation about Sites]( + www.thecoolsite.com.ca/documentations/about/cool + (title)) for more information about... +| ^^^^^^^^ meta.paragraph meta.link.inline +| ^ punctuation.definition.metadata.end +| ^^^^^^^ string.quoted.other.markdown + +link with a single underscore inside the text : [@_test](http://example.com) +| ^^^^^^ meta.paragraph meta.link.inline.description - punctuation.definition +| ^ meta.paragraph meta.link.inline punctuation.definition.link.end + +[foo] +|<- meta.link.reference punctuation.definition.link.begin +|^^^ meta.paragraph meta.link.reference +| ^ meta.link.reference punctuation.definition.link.end + +This is literal [Foo*bar\]] but [ref][Foo*bar\]] +| ^^^^^^^^^^^ meta.link.reference.description.markdown +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^ - constant +| ^^ constant.character.escape.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^^^ meta.link.reference.metadata.markdown + +[**Read more →**][details] +|^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^ meta.link.reference.metadata.markdown +|^^ punctuation.definition.bold.begin.markdown +| ^^^^^^^ constant.character.entity.decimal.html +| ^^ punctuation.definition.bold.end.markdown +| ^^^^^^^ markup.underline.link.markdown + +[Read more →][details] +|^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^ meta.link.reference.metadata.markdown +| ^^^^^^^ constant.character.entity.decimal.html +| ^^^^^^^ markup.underline.link + +[Read more ][details] +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^ meta.link.reference.metadata.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.tag +| ^^^^^^^^^^^^^^^^^^ source.css +| ^^^^^^^ constant.character.entity.decimal.html - meta.tag +| ^^^^^^^ meta.tag +| ^^^^^^^ markup.underline.link + +[![Cool ★ Image - Click to Enlarge][img-example]][img-example] +| <- meta.link.reference.description.markdown punctuation.definition.link.begin.markdown +|^^ meta.link.reference.description.markdown meta.image.reference.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description.markdown meta.image.reference.description.markdown +| ^^^^^^^^^^^^^^ meta.link.reference.description.markdown +| ^^^^^^^^^^^^^ meta.link.reference.metadata.markdown +|^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^ markup.underline.link +| ^ punctuation.definition.metadata.end.markdown + +[![Cool ★ Image - Click to Enlarge](http://www.sublimetext.com/anim/rename2_packed.png)](http://www.sublimetext.com/anim/rename2_packed.png) +| <- meta.paragraph.markdown meta.link.inline.description.markdown punctuation.definition.link.begin.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inline.description.markdown meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inline.description.markdown meta.image.inline.metadata.markdown +| ^ meta.paragraph.markdown meta.link.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inline.metadata.markdown +|^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown +| ^ punctuation.definition.link.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown + +[link [containing] [square] brackets](#backticks) +|<- punctuation.definition.link.begin +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description +| ^ punctuation.definition.link.end + +[link `containing square] brackets] in backticks`[]](#wow) +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description +| ^ punctuation.definition.raw.begin +| ^ punctuation.definition.raw.end +| ^ punctuation.definition.link.end + +[link ``containing square]` brackets[[][] in backticks``](#wow) +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline.description +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.inline +| ^^ punctuation.definition.raw.begin +| ^^ punctuation.definition.raw.end +| ^ punctuation.definition.link.end + +This is a [reference] () +| ^^^^^^^^^^^ meta.link.reference +| ^^^^ - meta.link + +This is a [reference] (followed by parens) +| ^^^^^^^^^^^ meta.link.reference +| ^^^^^^^^^^^^^^^^^^^^^ - meta.link + +This is a [reference] [] +| ^^^^^^^^^^^ meta.link.reference +| ^ - meta.link +| ^^ meta.link.reference + +This is a ![reference] () +| ^^^^^^^^^^^^^^^ - meta.image +| ^^^^^^^^^^^ meta.link.reference +| ^^^^ - meta.link + +This is a ![reference] (followed by parens) +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.image +| ^^^^^^^^^^^ meta.link.reference +| ^^^^^^^^^^^^^^^^^^^^^ - meta.link + +This is a ![reference] [] +| ^^^^^^^^^^^^^^^ - meta.image +| ^^^^^^^^^^^ meta.link.reference +| ^ - meta.link +| ^^ meta.link.reference + + +# TEST: IMAGES ################################################################ + +Here is a ![](https://example.com/cat.gif). +| ^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a ![](https://example.com/cat.gif){_at"r=value :att2}. +| ^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^^^^^^^^^^^^^^^^^^ meta.image.inline.attributes.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata +| ^ punctuation.definition.attributes.begin.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ invalid.illegal.attribute-name.markdown +| ^ punctuation.separator.key-value.markdown +| ^^^^^ string.unquoted.markdown +| ^^^^^ entity.other.attribute-name.markdown +| ^ punctuation.definition.attributes.end.markdown + +Here is a ![Image Alt Text](https://example.com/cat.gif). +| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a ![Image Alt Text]( https://example.com/cat.gif ). +| ^^^^^^^^^^^^^^^^^ meta.image.inline.description.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.image.inline.metadata.markdown +| ^^ - meta.image +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end - string +| ^ punctuation.definition.metadata.begin.markdown +| ^^ - markup.underline +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^^ - markup.underline +| ^ punctuation.definition.metadata.end.markdown + +Here is a ![Image Alt Text]( + https://example.com/cat.gif ). +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a ![Image Alt Text]( + https://example.com/cat.gif + "hello" ). +|^^^^^^^ meta.image.inline string.quoted.double +| ^^^^ meta.image.inline +| ^ punctuation.definition.metadata.end + +Here is a ![Image Alt Text]( + "hello" ). +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown +| ^^ meta.paragraph.markdown - meta.image +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^^^ string.quoted.double.markdown +| ^ punctuation.definition.string.begin.markdown +| ^ punctuation.definition.string.end.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a ![Image Alt Text]( + (hello) ). +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown +| ^^ meta.paragraph.markdown - meta.image +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^^^ string.quoted.other.markdown +| ^ punctuation.definition.string.begin.markdown +| ^ punctuation.definition.string.end.markdown +| ^ punctuation.definition.metadata.end.markdown + +Here is a ![Image Alt Text]( + https://example .com /cat.gif (hello) ). +|^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline +| ^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.image.inline.metadata.markdown markup.underline.link.image.markdown +| ^ meta.paragraph.markdown meta.image.inline.metadata.markdown - markup.underline +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.image - markup.underline + +Here is a ![Image Ref Alt][1]. +| ^^^^^^^^^^^^^^^^ meta.image.reference.description.markdown +| ^^^ meta.image.reference.metadata.markdown +| ^^ punctuation.definition.image.begin.markdown +| ^ punctuation.definition.image.end.markdown +| ^ punctuation.definition.metadata.begin.markdown +| ^ markup.underline.link.markdown +| ^ punctuation.definition.metadata.end.markdown + + +# TEST: FOOTNOTES ############################################################# + +## https://michelf.ca/projects/php-markdown/extra/#footnotes + +That's some text with a footnote.[^1] +| ^^^^ meta.paragraph meta.link.reference.footnote.markdown-extra +| ^ punctuation.definition.link.begin +| ^^ meta.link.reference.literal.footnote-id +| ^ punctuation.definition.link.end + +Here is a footnote[^1][link][] or long[^longnote][link][]. +| ^^^^ meta.link.reference.footnote.markdown-extra +| ^^^^^^ meta.link.reference.literal.description.markdown +| ^^ meta.link.reference.literal.metadata.markdown +| ^^^^^^^^^^^ meta.link.reference.footnote.markdown-extra +| ^^^^^^^^ meta.link.reference.literal + +Here is a footnote [^footnote](not_link_dest). +| ^^^^^^^^^^^ meta.paragraph.markdown meta.link.reference.footnote.markdown-extra +| ^ punctuation.definition.link.begin.markdown +| ^^^^^^^^^ meta.link.reference.literal.footnote-id.markdown +| ^ punctuation.definition.link.end.markdown +| ^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.link + + +# TEST: COMMONMARK AUTOLINKS ################################################## + + +| <- meta.link.email.markdown punctuation.definition.link.begin.markdown - markup.underline +|^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown +| ^ meta.link.email.markdown - markup.underline +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.definition.link.end.markdown + + +| <- meta.link.email.markdown punctuation.definition.link.begin.markdown - markup.underline +|^^^^^^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown +| ^ meta.link.email.markdown - markup.underline +| ^ punctuation.separator.path.markdown +| ^ punctuation.definition.link.end.markdown + + +| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown - markup.underline +|^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown +| ^ meta.link.inet.markdown - markup.underline +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.definition.link.end.markdown + + +| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown - markup.underline +|^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown +| ^ meta.link.inet.markdown - markup.underline +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.definition.link.end.markdown + + +| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown - markup.underline +|^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown +| ^ meta.link.inet.markdown - markup.underline +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.definition.link.end.markdown + + +| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown - markup.underline +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown +| ^ meta.link.inet.markdown - markup.underline +| ^^^ punctuation.separator.path.markdown +| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown +| ^^ constant.character.escape.url.markdown - punctuation +| ^ punctuation.separator.path.markdown + + +| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown +|^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown +| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown + + +| <- meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.begin.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown meta.link.inet.markdown markup.underline.link.markdown +| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown +| ^^^ punctuation.separator.path.markdown + + +| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown +|^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown +| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown + + +| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown +|^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown +| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown + + +| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown +|^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown +| ^^^^^^ - meta.link +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown + + +| <- meta.link.inet.markdown punctuation.definition.link.begin.markdown +|^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link.markdown +| ^ meta.paragraph.markdown meta.link.inet.markdown punctuation.definition.link.end.markdown +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown + + +# TEST: GFM AUTOLINKS ######################################################### + +Visit ftp://intra%20net +| ^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^^^ punctuation.separator.path.markdown +| ^ - constant +| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown +| ^^ constant.character.escape.url.markdown - punctuation +| ^^^ - constant + +Visit http://intra%20net +| ^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^^^ punctuation.separator.path.markdown +| ^ - constant +| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown +| ^^ constant.character.escape.url.markdown - punctuation +| ^^^ - constant + +Visit https://intra%20net +| ^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^^^ punctuation.separator.path.markdown +| ^ - constant +| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown +| ^^ constant.character.escape.url.markdown - punctuation +| ^^^ - constant + +Visit www.intra%20net +| ^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^ - constant +| ^ constant.character.escape.url.markdown punctuation.definition.escape.markdown +| ^^ constant.character.escape.url.markdown - punctuation +| ^^^ - constant + +Visit www.commonmark.org/help for more information. +| ^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^ punctuation.separator.path.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^ - markup.underline.link + +Visit www.commonmark.org. +| ^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inet.markdown markup.underline.link +| ^^ - markup.underline.link + +Visit www.commonmark.org/a.b. +| ^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inet.markdown markup.underline.link +| ^ - markup.underline.link +| ^ punctuation.separator.path.markdown -This is _**italic bold**_ -| ^^^^^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end -| ^ punctuation.definition.italic.end +www.google.com/search?q=(business))+ok +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ - markup.underline.link -This is *__italic bold__* -| ^^^^^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end -| ^ punctuation.definition.italic.end +www.google.com/search?q=Markup+(business) +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown -**test!_test** Issue 1163 -|^^^^^^^^^^^^^ markup.bold -| ^ - punctuation.definition.italic -| ^^ punctuation.definition.bold.end +www.commonmark.org/he +|^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^ punctuation.separator.path.markdown +| ^ - markup.underline.link -__test!*test__ Issue 1163 -|^^^^^^^^^^^^^ markup.bold -| ^ - punctuation.definition.italic -| ^^ punctuation.definition.bold.end +http://commonmark.org +|^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^^^ punctuation.separator.path.markdown -# TEST: STRIKETHROUGH ######################################################### +www.google.com/search?q=commonmark&hl=en +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ - markup.underline.link -__~~bold striked~~__ -| <- markup.bold.markdown punctuation.definition.bold.begin.markdown -|^ markup.bold.markdown - markup.strikethrough -| ^^^^^^^^^^^^^^^^ markup.bold.markdown markup.strikethrough.markdown-gfm -| ^^ markup.bold.markdown - markup.strikethrough -|^ punctuation.definition.bold.begin.markdown -| ^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^^ punctuation.definition.bold.end.markdown +www.google.com/search?q=commonmark&hl; +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^^^^ constant.character.entity.named.html - markup.underline.link -**~~bold striked~~** -| <- markup.bold.markdown punctuation.definition.bold.begin.markdown -|^ markup.bold.markdown - markup.strikethrough -| ^^^^^^^^^^^^^^^^ markup.bold.markdown markup.strikethrough.markdown-gfm -| ^^ markup.bold.markdown - markup.strikethrough -|^ punctuation.definition.bold.begin.markdown -| ^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^^ punctuation.definition.bold.end.markdown +www.google.com/search?q=commonmark&hl;&hl; +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^^^^^^^^ constant.character.entity.named.html - markup.underline.link -_~~italic striked~~_ -| <- markup.italic.markdown punctuation.definition.italic.begin.markdown -|^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.strikethrough.markdown-gfm -| ^ markup.italic.markdown - markup.strikethrough -|^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^ punctuation.definition.italic.end.markdown +www.google.com/search?q=commonmark&hl;! +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^^^^^^ - meta.link +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^^^^ constant.character.entity.named.html - markup.underline.link -*~~italic striked~~* -| <- markup.italic.markdown punctuation.definition.italic.begin.markdown -|^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.strikethrough.markdown-gfm -| ^ markup.italic.markdown - markup.strikethrough -|^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^ punctuation.definition.italic.end.markdown +www.google.com/search?q=commonmark&hl;f +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^ - meta.link +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^^^^ - constant.character -___~~bold italic striked~~___ -| <- markup.bold.markdown punctuation.definition.bold.begin.markdown -|^ markup.bold.markdown - markup.italic - markup.strikethrough -| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough -| ^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.strikethrough.markdown-gfm -| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough -| ^^ markup.bold.markdown - markup.italic - markup.strikethrough -|^ punctuation.definition.bold.begin.markdown -| ^ punctuation.definition.italic.begin.markdown -| ^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^ punctuation.definition.italic.end.markdown -| ^^ punctuation.definition.bold.end.markdown +(Visit https://encrypted.google.com/search?q=Markup+(business)) +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^^ - markup.underline.link -***~~bold italic striked~~*** -| <- markup.bold.markdown punctuation.definition.bold.begin.markdown -|^ markup.bold.markdown - markup.italic - markup.strikethrough -| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough -| ^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.strikethrough.markdown-gfm -| ^ markup.bold.markdown markup.italic.markdown - markup.strikethrough -| ^^ markup.bold.markdown - markup.italic - markup.strikethrough -|^ punctuation.definition.bold.begin.markdown -| ^ punctuation.definition.italic.begin.markdown -| ^^ punctuation.definition.strikethrough.begin.markdown -| ^^ punctuation.definition.strikethrough.end.markdown -| ^ punctuation.definition.italic.end.markdown -| ^^ punctuation.definition.bold.end.markdown +Anonymous FTP is available at ftp://foo.bar.baz. +| ^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^^^ punctuation.separator.path.markdown +| ^^ - markup.underline.link -~Hi~ Hello, world! -| <- - punctuation.definition.strikethrough -|^^^^^^^^^^^^^^^^^ meta.paragraph - markup -| ^ - punctuation.definition.strikethrough +(see http://www.google.com/search?q=commonmark&hl=en) +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link +| ^^^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^ punctuation.separator.path.markdown +| ^^ - markup.underline.link -This ~text~~~~ is ~~~~curious~. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - markup -| ^ - punctuation.definition.strikethrough -| ^^^^ - punctuation.definition.strikethrough -| ^^^^ - punctuation.definition.strikethrough -| ^ - punctuation.definition.strikethrough +foo@bar.baz +| <- meta.link.email.markdown markup.underline.link.markdown +|^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown +| ^ punctuation.separator.path.markdown +| ^ - meta.link - markup.underline.link -This ~~text~~~~ is ~~~~curious~~. -|^^^^ meta.paragraph - markup -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph markup.strikethrough -| ^^ meta.paragraph - markup -| ^^ punctuation.definition.strikethrough.begin -| ^^^^ - punctuation.definition.strikethrough -| ^^^^ - punctuation.definition.strikethrough -| ^^ punctuation.definition.strikethrough.end +hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.link - markup.underline.link +| ^^^^^^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown -This ~~has a -| ^^^^^^^^ meta.paragraph markup.strikethrough + test@test.test.me +| <- - meta.link - markup.underline +|^^^^^^^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown +| ^ punctuation.separator.path.markdown +| ^ - meta.link - markup.underline.link -| <- meta.paragraph markup.strikethrough invalid.illegal.non-terminated.bold-italic -new paragraph~~. -| ^^ meta.paragraph markup.strikethrough punctuation.definition.strikethrough.begin + a.b-c_d@a.b +| <- - meta.link - markup.underline +|^^^^^^^^^^^ meta.link.email.markdown markup.underline.link.markdown +| ^ punctuation.separator.path.markdown +| ^ - meta.link - markup.underline.link -| <- invalid.illegal.non-terminated.bold-italic +a.b-c_d@a.b. +|^^^^^^^^^^ markup.underline.link +| ^^ - markup.underline.link + + a.b-c_d@a.b- +| <- - meta.link - markup.underline +|^^^^^^^^^^^^^ - meta.link - markup.underline.link + + a.b-c_d@a.b_ +| <- - meta.link - markup.underline +|^^^^^^^^^^^^^ - meta.link - markup.underline.link hard line break | ^^ meta.hard-line-break punctuation.definition.hard-line-break @@ -4810,54 +4934,6 @@ soft line break | ^^^ - meta.hard-line-break not a hard line break` -*test - -| <- invalid.illegal.non-terminated.bold-italic -abc* -| ^ - punctuation - -_test - -| <- invalid.illegal.non-terminated.bold-italic -abc_ -| ^ - punctuation - -**test - -| <- invalid.illegal.non-terminated.bold-italic -abc** -| ^^ - punctuation - -__test - -| <- invalid.illegal.non-terminated.bold-italic -abc__ -| ^^ - punctuation - -__test\ -| ^ meta.hard-line-break constant.character.escape -testing__ - -http://spec.commonmark.org/0.27/#example-407 -**foo [*bar*](/url)** -| <- punctuation.definition.bold.begin -| ^^^^^^^^^^^^^ markup.bold meta.link.inline -| ^^ punctuation.definition.bold.end -| ^ punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end -**foo [_bar_](/url)** -| <- punctuation.definition.bold.begin -| ^^^^^^^^^^^^^ markup.bold meta.link.inline -| ^^ punctuation.definition.bold.end -| ^ punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end -_foo [**bar**](/url)_ -| <- punctuation.definition.italic.begin -| ^^^^^^^^^^^^^^^ markup.italic meta.link.inline -| ^ punctuation.definition.italic.end -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end - # TEST: CRITIC MARKUP ######################################################### From 698b94a6849a1d26e458cb14a3ac361510e9bbac Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Tue, 28 Dec 2021 13:56:44 +0100 Subject: [PATCH 25/63] Syntax: Reorganize hard line breaks tests This commit moves existing hard line break related tests to a dedicated section whose position matches the specification's chapter. --- syntaxes/Markdown.sublime-syntax | 1 + tests/syntax_test_markdown.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index c2b3f61d..a2474d3b 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -2994,6 +2994,7 @@ contexts: scope: constant.character.escape.markdown hard-line-breaks: + # https://spec.commonmark.org/0.30/#hard-line-breaks - match: '[ ]{2,}$' scope: meta.hard-line-break.markdown punctuation.definition.hard-line-break.markdown - match: (\\)\n diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index ebe0922a..da944829 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -4914,6 +4914,9 @@ a.b-c_d@a.b. | <- - meta.link - markup.underline |^^^^^^^^^^^^^ - meta.link - markup.underline.link + +# TEST: HARD LINE BREAKS ###################################################### + hard line break | ^^ meta.hard-line-break punctuation.definition.hard-line-break hard line break\ From a0fd827a614010f30de043e2555bc6df4236a0e3 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Thu, 6 Jan 2022 18:26:12 +0100 Subject: [PATCH 26/63] Colors: Fix Monokai/Mariana strikethrough colors --- messages/3.1.1.md | 1 + schemes/Mariana.sublime-color-scheme | 22 ++++++++++++---------- schemes/Monokai.sublime-color-scheme | 13 ++++++------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index 2339cae2..4d50aea8 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -12,6 +12,7 @@ feedback you can use [GitHub issues][issues]. * fix CommonMark compatibility of indented code blocks (mixed tabs/spaces) * fix CommonMark compatibility of reference definitions * fix CommonMark compatibility of thematic breaks +* fix strikethrough colors in Monokai/Mariana (fixes #678) * update strikethough markup to use 2 tildes (fixes #637) ## New Features diff --git a/schemes/Mariana.sublime-color-scheme b/schemes/Mariana.sublime-color-scheme index d5f65a2a..64c3df59 100644 --- a/schemes/Mariana.sublime-color-scheme +++ b/schemes/Mariana.sublime-color-scheme @@ -4,7 +4,10 @@ "variables": { "line_break": "hsl(210, 15%, 20%)", "raw_fg": "hsl(210, 10%, 60%)", - "raw_bg": "hsl(210, 15%, 20%)" + "raw_bg": "hsl(210, 15%, 20%)", + + "strikethrough_content_fg": "color(var(pink) a(0.5))", + "strikethrough_punctuation_fg": "color(var(pink) a(0.8))" }, "rules": [ @@ -56,21 +59,20 @@ }, { "name": "Striked Content", - "scope": "text.html.markdown markup.strikethrough", - "foreground": "var(grey)", + "scope": "text.html.markdown markup.strikethrough, text.html.markdown markup.strikethrough string", + "foreground": "var(strikethrough_content_fg)", "font_style": "" }, { - "name": "Striked References", - "scope": "text.html.markdown markup.strikethrough & (punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata)", - "foreground": "var(grey)", + "name": "Striked Punctuations", + "scope": "text.html.markdown markup.strikethrough & (punctuation.definition | punctuation.separator | punctuation.definition.strikethrough | punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata)", + "foreground": "var(strikethrough_punctuation_fg)", "font_style": "" }, { - "name": "Striked Strings", - "scope": "text.html.markdown markup.strikethrough string", - "foreground": "var(grey)", - "font_style": "" + "name": "Striked URLs", + "scope": "text.html.markdown markup.strikethrough & (markup.underline.link.markdown | markup.underline.link.image.markdown)", + "foreground": "var(strikethrough_content_fg)" }, { "name": "Markdown: Hard Line Breaks", diff --git a/schemes/Monokai.sublime-color-scheme b/schemes/Monokai.sublime-color-scheme index c70e9ab2..24b8298f 100644 --- a/schemes/Monokai.sublime-color-scheme +++ b/schemes/Monokai.sublime-color-scheme @@ -56,21 +56,20 @@ }, { "name": "Striked Content", - "scope": "text.html.markdown markup.strikethrough", + "scope": "text.html.markdown markup.strikethrough, text.html.markdown markup.strikethrough string", "foreground": "var(grey)", "font_style": "" }, { - "name": "Striked References", - "scope": "text.html.markdown markup.strikethrough & (punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata)", + "name": "Striked Punctuations", + "scope": "text.html.markdown markup.strikethrough & (punctuation.definition | punctuation.separator | punctuation.definition.strikethrough | punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata)", "foreground": "var(grey)", "font_style": "" }, { - "name": "Striked Strings", - "scope": "text.html.markdown markup.strikethrough string", - "foreground": "var(grey)", - "font_style": "" + "name": "Striked URLs", + "scope": "text.html.markdown markup.strikethrough & (markup.underline.link.markdown | markup.underline.link.image.markdown)", + "foreground": "var(grey)" }, { "name": "Markdown: Hard Line Breaks", From 7e938c17e7b9892af9f67dcc3178da62269b15e7 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Thu, 6 Jan 2022 19:07:32 +0100 Subject: [PATCH 27/63] Tests: Fix ST3176 test compatibility --- tests/syntax_test_markdown.md | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index da944829..ce5e36c1 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1445,10 +1445,10 @@ bar | ^^^^ meta.code-fence.definition.begin.ruby.markdown-gfm constant.other.language-name.markdown | ^ meta.code-fence.definition.begin.ruby.markdown-gfm - constant def foo(x) -| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby meta.function.ruby keyword.declaration.function.ruby +| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby meta.function return 3 end -| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby keyword.control.block.end.ruby +| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby keyword ``` | <- meta.code-fence.definition.end.ruby.markdown-gfm punctuation.definition.raw.code-fence.end.markdown |^^ meta.code-fence.definition.end.ruby.markdown-gfm punctuation.definition.raw.code-fence.end.markdown @@ -1462,10 +1462,10 @@ end | ^^^^ meta.code-fence.definition.begin.ruby.markdown-gfm constant.other.language-name.markdown | ^^^^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.ruby.markdown-gfm - constant def foo(x) -| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby meta.function.ruby keyword.declaration.function.ruby +| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby meta.function return 3 end -| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby keyword.control.block.end.ruby +| <- markup.raw.code-fence.ruby.markdown-gfm source.ruby keyword ~~~~~~~ | <- meta.code-fence.definition.end.ruby.markdown-gfm punctuation.definition.raw.code-fence.end.markdown |^^^^^^ meta.code-fence.definition.end.ruby.markdown-gfm punctuation.definition.raw.code-fence.end.markdown @@ -1668,7 +1668,7 @@ unclosed_paren = ( ```regex (?x) \s+ -| <- markup.raw.code-fence.regexp.markdown-gfm source.regexp meta.mode.extended.regexp keyword.control +| <- markup.raw.code-fence.regexp.markdown-gfm source.regexp ``` | <- meta.code-fence.definition.end.regexp.markdown-gfm punctuation.definition.raw.code-fence.end.markdown |^^ meta.code-fence.definition.end.regexp.markdown-gfm punctuation.definition.raw.code-fence.end.markdown @@ -1711,20 +1711,6 @@ FROM TableName | <- meta.code-fence.definition.end.sql.markdown-gfm punctuation.definition.raw.code-fence.end.markdown |^^ meta.code-fence.definition.end.sql.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -```ts -declare type foo = 'bar' -| <- markup.raw.code-fence.typescript.markdown-gfm source.ts -``` -| <- meta.code-fence.definition.end.typescript.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -|^^ meta.code-fence.definition.end.typescript.markdown-gfm punctuation.definition.raw.code-fence.end.markdown - -```tsx - -| <- markup.raw.code-fence.tsx.markdown-gfm -``` -| <- meta.code-fence.definition.end.tsx.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -|^^ meta.code-fence.definition.end.tsx.markdown-gfm punctuation.definition.raw.code-fence.end.markdown - ```xml |^^^^^ meta.code-fence.definition.begin.xml | ^^^ constant.other.language-name @@ -1972,10 +1958,10 @@ okay okay | <- - meta.disable-markdown From 0b142afff2544efe6ca86cc5f8f44771ac9b831a Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Thu, 6 Jan 2022 21:24:48 +0100 Subject: [PATCH 28/63] Colors: Tweak Monokai/Mariana strikethrough colors Fixes some punctuation not beeing dimmed. Tints strikethrough grey instead of pink in Mariana. --- schemes/Mariana.sublime-color-scheme | 6 +++--- schemes/Monokai.sublime-color-scheme | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/schemes/Mariana.sublime-color-scheme b/schemes/Mariana.sublime-color-scheme index 64c3df59..2f56f7b9 100644 --- a/schemes/Mariana.sublime-color-scheme +++ b/schemes/Mariana.sublime-color-scheme @@ -6,8 +6,8 @@ "raw_fg": "hsl(210, 10%, 60%)", "raw_bg": "hsl(210, 15%, 20%)", - "strikethrough_content_fg": "color(var(pink) a(0.5))", - "strikethrough_punctuation_fg": "color(var(pink) a(0.8))" + "strikethrough_content_fg": "hsl(0, 0%, 45%)", + "strikethrough_punctuation_fg": "hsl(0, 0%, 50%)" }, "rules": [ @@ -65,7 +65,7 @@ }, { "name": "Striked Punctuations", - "scope": "text.html.markdown markup.strikethrough & (punctuation.definition | punctuation.separator | punctuation.definition.strikethrough | punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata)", + "scope": "text.html.markdown markup.strikethrough & (punctuation.definition | punctuation.separator | punctuation.definition.strikethrough | punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata | markup.bold punctuation.definition.bold | markup.italic punctuation.definition.italic | string punctuation.definition.string)", "foreground": "var(strikethrough_punctuation_fg)", "font_style": "" }, diff --git a/schemes/Monokai.sublime-color-scheme b/schemes/Monokai.sublime-color-scheme index 24b8298f..6787e0de 100644 --- a/schemes/Monokai.sublime-color-scheme +++ b/schemes/Monokai.sublime-color-scheme @@ -62,7 +62,7 @@ }, { "name": "Striked Punctuations", - "scope": "text.html.markdown markup.strikethrough & (punctuation.definition | punctuation.separator | punctuation.definition.strikethrough | punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata)", + "scope": "text.html.markdown markup.strikethrough & (punctuation.definition | punctuation.separator | punctuation.definition.strikethrough | punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata | punctuation.definition.bold | punctuation.definition.italic | punctuation.definition.string)", "foreground": "var(grey)", "font_style": "" }, From 0a97c242136023abd8bace50dbc7ebebf20da3db Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Thu, 13 Jan 2022 21:01:17 +0100 Subject: [PATCH 29/63] Colors: Another round trip to tweak Mariana strikethrough Make use of an existing dark bluish color. --- schemes/Mariana.sublime-color-scheme | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/schemes/Mariana.sublime-color-scheme b/schemes/Mariana.sublime-color-scheme index 2f56f7b9..d1df2959 100644 --- a/schemes/Mariana.sublime-color-scheme +++ b/schemes/Mariana.sublime-color-scheme @@ -4,10 +4,7 @@ "variables": { "line_break": "hsl(210, 15%, 20%)", "raw_fg": "hsl(210, 10%, 60%)", - "raw_bg": "hsl(210, 15%, 20%)", - - "strikethrough_content_fg": "hsl(0, 0%, 45%)", - "strikethrough_punctuation_fg": "hsl(0, 0%, 50%)" + "raw_bg": "hsl(210, 15%, 20%)" }, "rules": [ @@ -60,19 +57,19 @@ { "name": "Striked Content", "scope": "text.html.markdown markup.strikethrough, text.html.markdown markup.strikethrough string", - "foreground": "var(strikethrough_content_fg)", + "foreground": "var(blue4)", "font_style": "" }, { "name": "Striked Punctuations", "scope": "text.html.markdown markup.strikethrough & (punctuation.definition | punctuation.separator | punctuation.definition.strikethrough | punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata | markup.bold punctuation.definition.bold | markup.italic punctuation.definition.italic | string punctuation.definition.string)", - "foreground": "var(strikethrough_punctuation_fg)", + "foreground": "var(blue2)", "font_style": "" }, { "name": "Striked URLs", "scope": "text.html.markdown markup.strikethrough & (markup.underline.link.markdown | markup.underline.link.image.markdown)", - "foreground": "var(strikethrough_content_fg)" + "foreground": "var(blue4)" }, { "name": "Markdown: Hard Line Breaks", From 5526d1830f10899cb682e99dc10b05dd6719afe3 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Thu, 13 Jan 2022 21:03:48 +0100 Subject: [PATCH 30/63] Colors: Fix reference descriptions in Mariana/Monokai color scheme Previous commits removed `string` and `constant` scopes from reference descriptions, which causes them to look pretty plain in most color schemes. This commit restores old colors for Monokai/Mariana. --- messages/3.1.1.md | 3 ++- schemes/Mariana.sublime-color-scheme | 4 ++++ schemes/Monokai.sublime-color-scheme | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index 4d50aea8..0909a808 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -12,8 +12,9 @@ feedback you can use [GitHub issues][issues]. * fix CommonMark compatibility of indented code blocks (mixed tabs/spaces) * fix CommonMark compatibility of reference definitions * fix CommonMark compatibility of thematic breaks -* fix strikethrough colors in Monokai/Mariana (fixes #678) * update strikethough markup to use 2 tildes (fixes #637) +* restore link/image/reference description colors for Mariana/Monokai (fixes #670) +* fix strikethrough colors in Monokai/Mariana (fixes #678) ## New Features diff --git a/schemes/Mariana.sublime-color-scheme b/schemes/Mariana.sublime-color-scheme index d1df2959..1335e4b6 100644 --- a/schemes/Mariana.sublime-color-scheme +++ b/schemes/Mariana.sublime-color-scheme @@ -105,6 +105,10 @@ "scope": "text.html.markdown meta.link.inline markup.underline.link", "foreground": "var(pink)" }, + { + "scope": "(meta.image.inline.description.markdown, meta.image.reference.description.markdown, meta.link.inline.description.markdown, meta.link.reference.description.markdown, meta.link.reference.literal.description.markdown, meta.link.reference.wiki.description.markdown) - comment - constant - entity - punctuation - string", + "foreground": "var(blue)" + }, // Keyboard Shortcuts { diff --git a/schemes/Monokai.sublime-color-scheme b/schemes/Monokai.sublime-color-scheme index 6787e0de..31bf9be7 100644 --- a/schemes/Monokai.sublime-color-scheme +++ b/schemes/Monokai.sublime-color-scheme @@ -105,6 +105,10 @@ "scope": "text.html.markdown meta.link.inline markup.underline.link", "foreground": "var(blue)" }, + { + "scope": "(meta.image.inline.description.markdown, meta.image.reference.description.markdown, meta.link.inline.description.markdown, meta.link.reference.description.markdown, meta.link.reference.literal.description.markdown, meta.link.reference.wiki.description.markdown) - comment - constant - entity - punctuation - string", + "foreground": "var(yellow)" + }, // Keyboard Shortcuts { From 90e650507bd17a9e92af56f79dde083c9293152c Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Thu, 13 Jan 2022 21:25:06 +0100 Subject: [PATCH 31/63] Add recent releases to messages.json --- messages.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/messages.json b/messages.json index 5a3df7b7..628d9e8d 100644 --- a/messages.json +++ b/messages.json @@ -33,5 +33,7 @@ "3.0.4": "messages/3.0.4.md", "3.0.5": "messages/3.0.5.md", "3.0.6": "messages/3.0.6.md", - "3.0.7": "messages/3.0.7.md" + "3.0.7": "messages/3.0.7.md", + "3.1.0": "messages/3.1.0.md", + "3.1.1": "messages/3.1.1.md" } From 3619d220d378b29c2c56abfe431c7699d734ef73 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Wed, 29 Dec 2021 11:47:33 +0100 Subject: [PATCH 32/63] Syntax: Fix CommonMark compatibility of block quotes This commit... 1. adds all official CommonMark test cases, replacing some of the existing ones to avoid duplication. 2. fixes an incompatibility with regards to how indented code blocks terminate block quotes. --- messages/3.1.1.md | 1 + syntaxes/Markdown.sublime-syntax | 19 +- tests/syntax_test_markdown.md | 327 +++++++++++++++++++++++++++---- 3 files changed, 297 insertions(+), 50 deletions(-) diff --git a/messages/3.1.1.md b/messages/3.1.1.md index 0909a808..cedcf8ae 100644 --- a/messages/3.1.1.md +++ b/messages/3.1.1.md @@ -7,6 +7,7 @@ feedback you can use [GitHub issues][issues]. * fix regression with latex block highlighting in list items * fix CommonMark compatibility of backslash escapes +* fix CommonMark compatibility of block quotes * fix CommonMark compatibility of html entities * fix CommonMark compatibility of fenced code blocks * fix CommonMark compatibility of indented code blocks (mixed tabs/spaces) diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index a2474d3b..120687d7 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -308,15 +308,20 @@ contexts: block-quote-content: - include: block-quote-nested - - include: block-quote-code-block + - include: block-quote-indended-code-block + - include: block-quote-fenced-code-block - include: block-quote-list-item - include: atx-headings - - include: indented-code-blocks - include: thematic-breaks - match: '' set: block-quote-text - block-quote-code-block: + block-quote-indended-code-block: + - match: '{{indented_code_block}}.*$\n?' + scope: markup.raw.block.markdown + pop: true + + block-quote-fenced-code-block: - match: |- (?x) {{fenced_code_block_start}} @@ -326,9 +331,9 @@ contexts: 0: meta.code-fence.definition.begin.text.markdown-gfm 2: punctuation.definition.raw.code-fence.begin.markdown 5: constant.other.language-name.markdown - set: block-quote-code-block-content + set: block-quote-fenced-code-block-content - block-quote-code-block-content: + block-quote-fenced-code-block-content: - match: ^(?!\s*{{block_quote}}) pop: true - match: '{{fenced_code_block_end}}' @@ -340,9 +345,9 @@ contexts: captures: 1: punctuation.definition.blockquote.markdown - match: '' - push: block-quote-code-block-text + push: block-quote-fenced-code-block-text - block-quote-code-block-text: + block-quote-fenced-code-block-text: - meta_include_prototype: false - meta_content_scope: markup.raw.code-fence.markdown-gfm - match: ^ diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index ce5e36c1..0dcce55f 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -2664,10 +2664,262 @@ A line with bolded **|** # TEST: BLOCK QUOTES ########################################################## -> This is a block quote. It contains markup. -> Including things like *italics* -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote -| ^^^^^^^^^ markup.italic +## https://spec.commonmark.org/0.30/#example-228 + +> # Foo +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - markup.heading +| ^^^^^^ markup.quote.markdown markup.heading.1.markdown +| ^ punctuation.definition.heading.begin.markdown +| ^^^ entity.name.section.markdown + +> # Foo +> bar +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^ markup.quote.markdown + +> # Foo +> bar +> baz +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-229 + +># Foo +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^^ markup.quote.markdown markup.heading.1.markdown +|^ punctuation.definition.heading.begin.markdown +| ^^^ entity.name.section.markdown + +># Foo +>bar +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^ markup.quote.markdown + +># Foo +>bar +> baz +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-230 + + > # Foo +| <- markup.quote.markdown +|^^^^^^^^^^ markup.quote.markdown +| ^ punctuation.definition.blockquote.markdown +| ^^^^^^ markup.heading.1.markdown +| ^ punctuation.definition.heading.begin.markdown +| ^^^ entity.name.section.markdown + + > # Foo + > bar +| <- markup.quote.markdown - punctuation +|^^ markup.quote.markdown - punctuation +| ^ markup.quote.markdown punctuation.definition.blockquote.markdown +| ^^^^^ markup.quote.markdown - punctuation + + > # Foo + > bar + > baz +| <- markup.quote.markdown - punctuation +|^ markup.quote.markdown punctuation.definition.blockquote.markdown +| ^^^^^ markup.quote.markdown - punctuation + +## https://spec.commonmark.org/0.30/#example-231 + + > # Foo + > bar + > baz +| <- markup.raw.block.markdown +|^^^^^^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-232 + +> # Foo +> bar +baz +| <- markup.quote.markdown +|^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-233 + +> bar +baz +| <- markup.quote.markdown +|^^^ markup.quote.markdown +> foo +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^ markup.quote.markdown - punctuation + +## https://spec.commonmark.org/0.30/#example-234 + +> foo +*** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - markup.quote +|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - markup.quote + +> foo +--- +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - markup.quote +|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - markup.quote + +> foo +___ +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - markup.quote +|^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - markup.quote + +## https://spec.commonmark.org/0.30/#example-235 + +> - foo +- bar +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown - markup.quote +|^^^^^ markup.list.unnumbered.markdown - markup.quote + +## https://spec.commonmark.org/0.30/#example-236 + +> foo + bar +| <- markup.raw.block.markdown +|^^^^^^^ markup.raw.block.markdown + +## https://spec.commonmark.org/0.30/#example-237 + +> ``` +foo +| <- meta.paragraph.markdown - markup.quote - markup.raw +|^^^ meta.paragraph.markdown - markup.quote - markup.raw + +## https://spec.commonmark.org/0.30/#example-238 + +> foo + - bar +| <- markup.quote.markdown - markup.list - markup.raw +|^^^^^^^^^ markup.quote.markdown - markup.list - markup.raw + +## https://spec.commonmark.org/0.30/#example-239 + +> +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-240 + +> +> +> +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-241 + +> +> foo +> +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-242 + +> foo + +| <- - markup.quote +> foo + +> bar +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-243 + +> foo +> bar +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-244 + +> foo +> +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +> bar +| <- markup.quote.markdown punctuation.definition.blockquote.markdown + +## https://spec.commonmark.org/0.30/#example-245 + +foo +> bar +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-246 + +> aaa +*** +> bbb +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-247 + +> bar +baz +| <- markup.quote.markdown +|^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-248 + +> bar + +baz +| <- meta.paragraph.markdown - markup.quote +|^^ meta.paragraph.markdown - markup.quote + +## https://spec.commonmark.org/0.30/#example-249 + +> bar +> +baz +| <- markup.quote.markdown +|^^^ markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-250 + +> > > foo +| <- markup.quote.markdown punctuation.definition.blockquote.markdown - markup.quote markup.quote +|^ markup.quote.markdown - markup.quote markup.quote - punctuation +| ^ markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown - markup.quote markup.quote markup.quote +| ^ markup.quote.markdown markup.quote.markdown - markup.quote markup.quote markup.quote - punctuation +| ^ markup.quote.markdown markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown +| ^^^^^ markup.quote.markdown markup.quote.markdown markup.quote.markdown - punctuation + +> > > foo +bar +| <- markup.quote.markdown markup.quote.markdown markup.quote.markdown +|^^^ markup.quote.markdown markup.quote.markdown markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-251 + +>>> foo +> bar +>>baz +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown markup.quote.markdown punctuation.definition.blockquote.markdown +| ^^^^ markup.quote.markdown markup.quote.markdown - punctuation + +## https://spec.commonmark.org/0.30/#example-252 + +> code +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - markup.raw +| ^^^^^^^^^ markup.quote.markdown markup.raw.block.markdown + +> not code +| <- markup.quote.markdown punctuation.definition.blockquote.markdown - markup.raw +|^^^^^^^^^^^^^ markup.quote.markdown - markup.raw + +## https://custom-tests/block-quotes#valid-block-quote-starts >= | <- punctuation.definition.blockquote.markdown @@ -2678,23 +2930,12 @@ A line with bolded **|** >= | ^ punctuation.definition.blockquote.markdown >= -| ^^ - punctuation.definition.blockquote.markdown +| ^^^^^ markup.quote.markdown - punctuation >= -| ^^ - punctuation.definition.blockquote.markdown +| ^^ markup.raw.block.markdown - markup.quote - punctuation -> Block quote -| <- markup.quote punctuation.definition.blockquote -| ^^^^^^^^^^^ markup.quote - -> Block quote followed by an empty block quote line -> -| <- markup.quote punctuation.definition.blockquote - -> Block quote followed by an empty block quote line -> -> Followed by more quoted text -| <- markup.quote punctuation.definition.blockquote +## https://custom-tests/block-quotes#nested-block-quotes > > Nested block quote | <- markup.quote punctuation.definition.blockquote @@ -2707,15 +2948,6 @@ A line with bolded **|** > Followed by more quoted text that is not nested | <- markup.quote punctuation.definition.blockquote - markup.quote markup.quote -> Here is a block quote -This quote continues on. Line breaking is OK in markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote -> Here it is again -| <- punctuation.definition.blockquote - -paragraph -| <- meta.paragraph - > > this is a nested quote but no code in a block quote | <- punctuation.definition.blockquote | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown @@ -2724,10 +2956,7 @@ paragraph | <- punctuation.definition.blockquote | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block - markup.quote markup.quote -> CommonMark expects following line to be indented code block (see: example 326) - > but all common parsers handle it as continued text. -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown - markup.raw -| ^ - punctuation +## https://custom-tests/block-quotes#fenced-code-blocks > Quoted fenced code block begin > ``` @@ -2800,6 +3029,8 @@ no code block ``` | <- meta.code-fence.definition.end.text.markdown-gfm - markup.quote +## https://custom-tests/block-quotes#block-terminations + > Block quote followed by heading # heading | <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown @@ -2827,15 +3058,9 @@ no code block |^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown | ^^^^^^^^^^ markup.list.numbered.markdown - meta.quote -> Block quote followed by thematic break -*** -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote +## https://custom-tests/block-quotes#list-items -> Block quote followed by thematic break -- - - -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote - -> Block quote with list items +> Block quote with lists > - list item 1 | ^ markup.quote punctuation.definition.list_item > - list item 2 @@ -2853,6 +3078,8 @@ no code block continued | ^^^^^^^^^^ markup.quote.markdown markup.list.unnumbered.markdown meta.paragraph.list.markdown +## https://custom-tests/block-quotes#gfm-tasks + > Block quote with GFM tasks > * [ ] task | ^^^^^^^^^^^ markup.quote.markdown @@ -2888,6 +3115,20 @@ no code block | ^ markup.checkbox.mark.markdown-gfm - punctuation | ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm +## https://custom-tests/block-quotes#emphasis + +> Blcok quotes support markup, +> like *italics*, **bold**, ***bold italic*** and ~~strikethrough~~. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown +| ^^^^^^^^^ markup.italic.markdown +| ^^^^^^^^ markup.bold.markdown +| ^^ markup.bold.markdown punctuation.definition.bold.begin.markdown +| ^ markup.bold.markdown markup.italic.markdown punctuation.definition.italic.begin.markdown +| ^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown - punctuation +| ^ markup.bold.markdown markup.italic.markdown punctuation.definition.italic.end.markdown +| ^^ markup.bold.markdown punctuation.definition.bold.end.markdown +| ^^^^^^^^^^^^^^^^^ markup.strikethrough.markdown-gfm + # TEST: LIST BLOKCKS ########################################################## @@ -3198,12 +3439,12 @@ Paragraph break. code here > block quote code here -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered markup.quote markup.raw.block + | ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote + | ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered markup.quote markup.raw.block > > test -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote -| ^ markup.list.unnumbered markup.quote markup.quote punctuation.definition.blockquote - markup.raw.block + | ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote + | ^ markup.list.unnumbered markup.quote markup.quote punctuation.definition.blockquote - markup.raw.block - f | ^ markup.list.unnumbered.bullet punctuation.definition.list_item From 74690a1c18f6a3f57f807f6c98caa3c410bafc0b Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Wed, 29 Dec 2021 14:02:40 +0100 Subject: [PATCH 33/63] Syntax: Improve CommonMark compatibility of list blocks This commit... 1. restricts ordered lists' bullets to 1-9 digits according to the specs 2. drops support for indented code blocks within list blocks, as those can't be matched reliably enough and cause many issues with nested list items. 3. adds support for headings in list items 4. allows fenced code blocks to start at the first line of a list item 5. adds all official test cases, which seem useful. 6. reorganizes and tweaks existing test cases, but also removes those, which are covered by official tests. --- syntaxes/Markdown.sublime-syntax | 106 +-- tests/syntax_test_latex.md | 21 +- tests/syntax_test_markdown.md | 1519 +++++++++++++++++++++++------- 3 files changed, 1238 insertions(+), 408 deletions(-) diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 120687d7..6c67b652 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -26,7 +26,28 @@ variables: block_quote: (?:[ ]{,3}(>)[ ]?) # between 0 and 3 spaces, followed by a greater than sign, (followed by any character or the end of the line = "only care about optional space!") indented_code_block: (?:[ ]{4}|[ ]{0,3}\t) # a visual tab of width 4 consisting of 4 spaces or 0 to 3 spaces followed by 1 tab - list_item: (?:[ ]{,3}(?:\d+[.)]|[*+-])\s) # between 0 and 3 spaces, followed by either: at least one integer and a full stop or a parenthesis, or (a star, plus or dash), followed by whitespace + + list_item: (?:[ ]{,3}(?:\d{1,9}[.)]|[*+-])\s) # between 0 and 3 spaces, followed by either: at least one integer and a full stop or a parenthesis, or (a star, plus or dash), followed by whitespace + list_item_paragraph_end: |- + \s*(?x: + $ + | {{atx_heading}} # an ATX heading begins the line + | {{block_quote}} # a blockquote begins the line + | {{fenced_code_block_start}} # a fenced codeblock begins the line + | {{thematic_break}} # line is a thematic beak + | \d{1,9}[.)]\s # an ordered list item begins the line + | [*+-]\s # an unordered list item begins the line + | \$\$ # a latex math block begins the line + | {{html_tag_block_end_at_close_tag}} # html block type 1 + | {{html_tag_block_end_at_blank_line}} # html block type 6 + | {{html_block_open_tag}} # html block type 7 + | {{html_block_close_tag}} # html block type 7 + | {{html_block_comment}} # html block type 2 + | {{html_block_decl}} # html block type 4 + | {{html_block_cdata}} # html block type 5 + | {{html_block_preprocessor}} # html block type 3 + ) + thematic_break: |- (?x: [ ]{,3} # between 0 to 3 spaces @@ -354,7 +375,7 @@ contexts: pop: true block-quote-list-item: - - match: ([ ]{,3})(\d+([.)]))(\s) + - match: ([ ]{,3})(\d{1,9}([.)]))(\s) captures: 1: markup.list.numbered.markdown 2: markup.list.numbered.bullet.markdown @@ -400,7 +421,7 @@ contexts: ###[ CONTAINER BLOCKS: LISTS ]################################################ list-blocks: - - match: ^([ ]{,3})([*+-])( (\[)([ xX])(\]))?(?=\s) + - match: ([ ]*)([*+-])((?:[ ](\[)([ xX])(\]))?\s) captures: 1: markup.list.unnumbered.markdown 2: markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown @@ -408,42 +429,41 @@ contexts: 4: markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm 5: markup.checkbox.mark.markdown-gfm 6: markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm - push: unordered-list-paragraph - - match: ^([ ]{,3})(\d+([.)]))(?=\s) + push: unordered-list-block + - match: ([ ]*)(\d{1,9}([.)]))(\s) captures: 1: markup.list.numbered.markdown 2: markup.list.numbered.bullet.markdown 3: punctuation.definition.list_item.markdown - push: ordered-list-paragraph + 4: markup.list.numbered.markdown + push: ordered-list-block - unordered-list-paragraph: + unordered-list-block: - meta_content_scope: markup.list.unnumbered.markdown - - include: list-paragraph + - include: list-block-end + - include: list-block-content - ordered-list-paragraph: + ordered-list-block: - meta_content_scope: markup.list.numbered.markdown - - include: list-paragraph + - include: list-block-end + - include: list-block-content - list-paragraph: - - match: ^(?=\S|{{atx_heading}}) + list-block-end: + - match: ^(?=\S) pop: true - - include: list-indended-code-blocks - - include: block-quotes + + list-block-content: + - include: thematic-breaks - include: fenced-code-blocks - include: html-blocks + - include: latex-blocks - include: reference-definitions - - include: thematic-breaks + - include: atx-headings + - include: list-items - match: (?=\S) - push: list-items - - list-indended-code-blocks: - # at least 8 chars / 2 tabs - - match: ^{{indented_code_block}}{2,}[^>+*\s-].*$\n? - scope: markup.raw.block.markdown + push: list-content list-items: - - match: ^(?=\s*$|{{atx_heading}}) - pop: true - match: ([ ]*)([*+-])((?:[ ](\[)([ xX])(\]))?\s) captures: 1: markup.list.unnumbered.markdown @@ -452,47 +472,25 @@ contexts: 4: markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm 5: markup.checkbox.mark.markdown-gfm 6: markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm - push: unordered-list-content - - match: ([ ]*)(\d+([.)]))(?=\s) + - match: ([ ]*)(\d{1,9}([.)]))(\s) captures: 1: markup.list.numbered.markdown 2: markup.list.numbered.bullet.markdown 3: punctuation.definition.list_item.markdown - push: ordered-list-content - - match: \s+ - scope: meta.paragraph.list.markdown - - match: (?=\S) - push: list-content - - unordered-list-content: - - clear_scopes: 1 - - meta_content_scope: markup.list.unnumbered.markdown meta.paragraph.list.markdown - - include: list-content - - ordered-list-content: - - clear_scopes: 1 - - meta_content_scope: markup.list.numbered.markdown meta.paragraph.list.markdown - - include: list-content + 4: markup.list.numbered.markdown list-content: - - meta_content_scope: meta.paragraph.list.markdown - include: block-quotes - - include: fenced-code-blocks - - include: html-blocks - - include: latex-blocks - - include: reference-definitions - - include: thematic-breaks - match: ^ pop: true - - match: (?=\S) + - match: \s*(?=\S) push: list-text list-text: - - include: inlines - - match: $ - pop: true - - match: (?={{list_item}}) + - meta_scope: meta.paragraph.list.markdown + - match: ^(?={{list_item_paragraph_end}}) pop: true + - include: inlines ###[ LEAF BLOCKS: ATX HEADINGS ]############################################## @@ -640,7 +638,7 @@ contexts: fenced-code-blocks: # https://spec.commonmark.org/0.30/#fenced-code-blocks - - match: ^(?={{fenced_code_block_start}}) + - match: (?={{fenced_code_block_start}}) push: fenced-code-block-content fenced-code-block-content: @@ -2073,7 +2071,7 @@ contexts: footnote-definitions: # Mardown Extras Footnotes - - match: '[ ]{,3}(\[)({{footnote_name}})(\])(:)' + - match: '[ ]*(\[)({{footnote_name}})(\])(:)' captures: 1: punctuation.definition.reference.begin.markdown 2: entity.name.reference.link.markdown @@ -2092,7 +2090,7 @@ contexts: link-definitions: # https://spec.commonmark.org/0.30/#link-reference-definition - - match: '[ ]{,3}(\[)({{reference_name}})(\])(:)' + - match: '[ ]*(\[)({{reference_name}})(\])(:)' captures: 1: punctuation.definition.reference.begin.markdown 2: entity.name.reference.link.markdown diff --git a/tests/syntax_test_latex.md b/tests/syntax_test_latex.md index 11b33b80..8f5a9e5f 100644 --- a/tests/syntax_test_latex.md +++ b/tests/syntax_test_latex.md @@ -24,17 +24,16 @@ $$ 1. Numbered List $$ -| <- markup.list.numbered.markdown -|^^^^^ markup.list.numbered.markdown -| ^^ string.other.math.latex punctuation.definition.string.begin.latex + | <- markup.list.numbered.markdown string.other.math.latex punctuation.definition.string.begin.latex + |^ markup.list.numbered.markdown string.other.math.latex punctuation.definition.string.begin.latex foo = 1 + 2 -| <- markup.list.numbered.markdown text.tex.latex + | <- markup.list.numbered.markdown text.tex.latex $$ -| <- markup.list.numbered.markdown -|^^^^^ markup.list.numbered.markdown -| ^^ string.other.math.latex punctuation.definition.string.end.latex + | <- markup.list.numbered.markdown string.other.math.latex punctuation.definition.string.end.latex + |^ markup.list.numbered.markdown string.other.math.latex punctuation.definition.string.end.latex - $$1+1$$ -| ^^^^^^^ markup.list.numbered.markdown meta.paragraph.list.markdown text.tex.latex meta.environment.math.block.dollar.latex -| ^^ string.other.math.latex punctuation.definition.string.begin.latex -| ^^ string.other.math.latex punctuation.definition.string.end.latex + $$1+1$$ + | <- markup.list.numbered.markdown string.other.math.latex punctuation.definition.string.begin.latex + |^^^^^^ markup.list.numbered.markdown text.tex.latex meta.environment.math.block.dollar.latex + |^ string.other.math.latex punctuation.definition.string.begin.latex + | ^^ string.other.math.latex punctuation.definition.string.end.latex diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 0dcce55f..bb39b912 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -31,15 +31,17 @@ bar | <- markup.list.unnumbered.markdown -|^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown +|^^^^ markup.list.unnumbered.markdown ## https://spec.commonmark.org/0.30/#example-5 - foo bar -| <- markup.list.unnumbered.markdown markup.raw.block.markdown -|^^^^^ markup.list.unnumbered.markdown markup.raw.block.markdown +| <- markup.list.unnumbered.markdown - markup.raw.block.markdown +|^^^^^ markup.list.unnumbered.markdown - markup.raw.block.markdown + +> Note: `bar` should be indented code block, but ST can't reliably highlight it! ## https://spec.commonmark.org/0.30/#example-6 @@ -65,9 +67,9 @@ - foo - bar - baz -|^ markup.list.unnumbered.markdown meta.paragraph.list.markdown +|^ markup.list.unnumbered.markdown | ^ markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown +| ^^^^ markup.list.unnumbered.markdown ## https://spec.commonmark.org/0.30/#example-10 @@ -766,7 +768,7 @@ bar - Foo - * * * -| ^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.separator.thematic-break.markdown +| ^^^^^^ markup.list.unnumbered.markdown meta.separator.thematic-break.markdown # TEST: ATX HEADINGS ########################################################## @@ -2483,17 +2485,6 @@ blah text | <- meta.paragraph - meta.link.reference.def.markdown -1. list [001]blah -| ^^^^^ meta.link.reference -| ^ punctuation.definition.link.begin -| ^ punctuation.definition.link.end -| ^^^^^ - meta.link - - [001]: https://en.wikipedia.org/wiki/Root-mean-square_deviation "Wikipedia - RMSE" -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.link.reference.def.markdown -1. another list item -| <- markup.list.numbered.bullet.markdown - ## https://custom-tests/footnote-reference-definitions [^1]: And that's the footnote. @@ -3037,27 +3028,38 @@ no code block |^^^^^^^^^ markup.heading.1.markdown - meta.quote | ^^^^^^^ entity.name.section.markdown -> Block quote followed by list +> Block quote followed by unordered list * list item | <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown |^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote -> Block quote followed by list +> Block quote followed by unordered list + list item | <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown |^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote -> Block quote followed by list +> Block quote followed by unordered list - list item | <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown |^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote -> Block quote followed by list +> Block quote followed by ordered list 1. list item | <- markup.list.numbered.bullet.markdown - punctuation |^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown | ^^^^^^^^^^ markup.list.numbered.markdown - meta.quote +> Block quote followed by ordered list +2. list item +| <- markup.list.numbered.bullet.markdown - punctuation +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^ markup.list.numbered.markdown - meta.quote + +> Block quote followed by invalid list +1234567890. no list item +| <- markup.quote.markdown - markup.list +|^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown - markup.list + ## https://custom-tests/block-quotes#list-items > Block quote with lists @@ -3066,17 +3068,15 @@ no code block > - list item 2 | ^ markup.list.unnumbered.bullet punctuation.definition.list_item | ^^^^^^^^^^^^^^ markup.quote markup.list.unnumbered -| ^^^^^^^^^^^^ meta.paragraph.list > 1. sub list item | <- markup.quote punctuation.definition.blockquote |^^^^^^^^^^^^^^^^^^^^ markup.quote | ^ punctuation.definition.list_item | ^^ markup.list.numbered.bullet | ^^^^^^^^^^^^^^^^^^^ markup.list.numbered -| ^^^^^^^^^^^^^^ meta.paragraph.list > - list item 3 continued -| ^^^^^^^^^^ markup.quote.markdown markup.list.unnumbered.markdown meta.paragraph.list.markdown +| ^^^^^^^^^^ markup.quote.markdown markup.list.unnumbered.markdown ## https://custom-tests/block-quotes#gfm-tasks @@ -3130,408 +3130,1241 @@ no code block | ^^^^^^^^^^^^^^^^^ markup.strikethrough.markdown-gfm -# TEST: LIST BLOKCKS ########################################################## +# TEST: LIST BLOCKS ########################################################### + +## https://spec.commonmark.org/0.30/#example-253 + +A paragraph +with two lines. + + indented code + +> A block quote. +| <- markup.quote.markdown punctuation.definition.blockquote.markdown - markup.raw +|^^^^^^^^^^^^^^^^ markup.quote.markdown - markup.raw + +## https://spec.commonmark.org/0.30/#example-254 + +1. A paragraph + with two lines. + + indented code + + > A block quote. +| <- markup.list.numbered.markdown - markup.quote - markup.raw +|^^^ markup.list.numbered.markdown - markup.quote - markup.raw +| ^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.quote.markdown +| ^ punctuation.definition.blockquote.markdown + +## https://spec.commonmark.org/0.30/#example-255 + +- one + + two +| <- markup.list.unnumbered.markdown +|^^^^ markup.list.unnumbered.markdown + +> Note: `two` is not a part of the list item, but ST can't handle it! + +## https://spec.commonmark.org/0.30/#example-256 + +- one + + two +| <- markup.list.unnumbered.markdown +|^^^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-257 + + - one + + two +| <- markup.list.unnumbered.markdown +|^^^^^^^^ markup.list.unnumbered.markdown + +> Note: `two` is not a part of the list item, but ST can't handle it! + +## https://spec.commonmark.org/0.30/#example-258 + + - one + + two +| <- markup.list.unnumbered.markdown +|^^^^^^^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-261 + +Note that at least one space or tab is needed between the list marker +and any following content, so these are not list items: + +-one +| <- meta.paragraph.markdown - markup.list +|^^^^ meta.paragraph.markdown - markup.list + +2.two +| <- meta.paragraph.markdown - markup.list +|^^^^^ meta.paragraph.markdown - markup.list + +## https://spec.commonmark.org/0.30/#example-262 + +A list item may contain blocks that are separated by more than one blank line. + +- foo + + + bar + | <- markup.list.unnumbered.markdown + |^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-263 + +1. foo + + ``` + | <- markup.list.numbered.markdown meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown + bar + | <- markup.list.numbered.markdown markup.raw.code-fence.markdown-gfm - punctuation + ``` + | <- markup.list.numbered.markdown meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + + baz + | <- markup.list.numbered.markdown + + > bam + | <- markup.list.numbered.markdown markup.quote.markdown punctuation.definition.blockquote.markdown + |^^^^^ markup.list.numbered.markdown markup.quote.markdown -Paragraph of text that should be scoped as meta.paragraph. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph +## https://spec.commonmark.org/0.30/#example-265 -Paragraph followed immediately by a list, no blank line in between -- list item 1 -| <- markup.list.unnumbered punctuation.definition.list_item +Note that ordered list start numbers must be nine digits or less: -Paragraph followed immediately by a numbered list, no blank line in between -1. list item 1 +123456789. ok +| <- markup.list.numbered.bullet.markdown +|^^^^^^^^^ markup.list.numbered.bullet.markdown +| ^^^^ markup.list.numbered.markdown + +## https://spec.commonmark.org/0.30/#example-266 + +1234567890. not ok +| <- meta.paragraph.markdown - markup.list +|^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - markup.list + +## https://spec.commonmark.org/0.30/#example-267 + +0. ok +| <- markup.list.numbered.bullet.markdown +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^ markup.list.numbered.markdown + +## https://spec.commonmark.org/0.30/#example-268 + +003. ok +| <- markup.list.numbered.bullet.markdown +|^^^ markup.list.numbered.bullet.markdown +| ^ punctuation.definition.list_item.markdown +| ^^^^ markup.list.numbered.markdown + +## https://spec.commonmark.org/0.30/#example-269 + +-1. not ok +| <- meta.paragraph.markdown - markup.list +|^^^^^^^^^^ meta.paragraph.markdown - markup.list + +## https://spec.commonmark.org/0.30/#example-282 + +- foo +- +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^ markup.list.unnumbered.markdown + +- foo +- +- bar +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-283 + +1. foo +2. | <- markup.list.numbered.bullet.markdown -|^^^^^^^^^^^^^ markup.list.numbered |^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^^^ meta.paragraph.list - more text - this punctuation should be ignored 2. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list -| ^ - punctuation.definition.list_item -| ^ - punctuation.definition.list_item - -Paragraph not followed immediately by a numbered list, -because it doesn't begin with the number one: -2. text -| <- - markup.list.numbered -|^^^^^^ - markup.list.numbered - - 1. Ordered list item -| ^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered -| ^^ markup.list.numbered.bullet - markup.list.numbered markup.list.numbered -| ^ punctuation.definition.list_item - 2. Ordered list item #2 -| ^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered - markup.list.numbered markup.list.numbered -| ^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item - 1. Subitem - 2. Another subitem -|^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered -| ^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item -| ^^^^^^^^^^^^^^^^ meta.paragraph.list - meta.paragraph.list meta.paragraph.list - -Paragraph break. - -1) numberd item +| ^ markup.list.numbered.markdown - punctuation + +1. foo +2. +3. bar | <- markup.list.numbered.bullet.markdown |^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown +| ^^^^^ markup.list.numbered.markdown - punctuation + +## https://spec.commonmark.org/0.30/#example-284 + +* +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^ markup.list.unnumbered.markdown - punctuation + +## https://spec.commonmark.org/0.30/#example-285 - 2) numberd item +foo +* +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^ markup.list.unnumbered.markdown - punctuation + +foo +1. +| <- markup.list.numbered.bullet.markdown +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^ markup.list.numbered.markdown - punctuation + +## https://spec.commonmark.org/0.30/#example-286 + + 1. A paragraph + with two lines. + |^^^^^^^^^^^^^^^ markup.list.numbered.markdown + + indented code (but ST can't reliably highlight it!) + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown - markup.raw + + > A block quote. + |^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-287 + + 1. A paragraph + with two lines. + |^^^^^^^^^^^^^^^ markup.list.numbered.markdown + + indented code (but ST can't reliably highlight it!) + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown - markup.raw + + > A block quote. + | ^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-288 + + 1. A paragraph + with two lines. + |^^^^^^^^^^^^^^^ markup.list.numbered.markdown + + indented code (but ST can't reliably highlight it!) + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown - markup.raw + + > A block quote. + |^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-289 + + 1. A paragraph + with two lines. + |^^^^^^^^^^^^^^^ markup.raw.block.markdown - markup.list + + indented code + |^^^^^^^^^^^^^^^^^ markup.raw.block.markdown - markup.list + + > A block quote. + |^^^^^^^^^^^^^^^^ markup.raw.block.markdown - markup.list + +## https://spec.commonmark.org/0.30/#example-290 + + 1. A paragraph +with two lines. | <- markup.list.numbered.markdown -|^^ markup.list.numbered.bullet.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown +|^^^^^^^^^^^^^^^ markup.list.numbered.markdown + + indented code (but ST can't reliably highlight it!) + |^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown - markup.raw + + > A block quote. + | ^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-291 - 3) numberd item + 1. A paragraph + with two lines. + |^^^^^^^^^^^^^^^ markup.list.numbered.markdown + +## https://spec.commonmark.org/0.30/#example-292 + +> 1. > Blockquote +continued here. +| <- markup.quote.markdown markup.list.numbered.markdown markup.quote.markdown +|^^^^^^^^^^^^^^^ markup.quote.markdown markup.list.numbered.markdown markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-293 + +> 1. > Blockquote +> continued here. +| <- markup.quote.markdown markup.list.numbered.markdown markup.quote.markdown punctuation.definition.blockquote.markdown +|^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.list.numbered.markdown markup.quote.markdown + +## https://spec.commonmark.org/0.30/#example-294 + +So, in this case we need two spaces indent: + +- foo + - bar + - baz + - boo +| <- markup.list.unnumbered.markdown +|^^^^^ markup.list.unnumbered.markdown +| ^ markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-295 + +One is not enough: + +- foo + - bar + - baz + - boo +| <- markup.list.unnumbered.markdown +|^^ markup.list.unnumbered.markdown +| ^ markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-296 + +Here we need four, because the list marker is wider: + +10) foo + - bar | <- markup.list.numbered.markdown -|^ markup.list.numbered.markdown -| ^^ markup.list.numbered.bullet.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown +|^^^ markup.list.numbered.markdown +| ^ markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^ markup.list.numbered.markdown + +## https://spec.commonmark.org/0.30/#example-297 - 4) numberd item +Three is not enough: + +10) foo + - bar | <- markup.list.numbered.markdown |^^ markup.list.numbered.markdown -| ^^ markup.list.numbered.bullet.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown +| ^ markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^ markup.list.numbered.markdown - 5) numberd item -| <- markup.list.numbered.markdown -|^^^ markup.list.numbered.markdown -| ^^ markup.list.numbered.bullet.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown +## https://spec.commonmark.org/0.30/#example-298 -Paragraph break. +A list may be the first block in a list item: - 5) code block -| <- markup.raw.block.markdown - markup.list -|^^^^^^^^^^^^^^^^^ markup.raw.block.markdown - markup.list +- - foo +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^ markup.list.unnumbered.markdown +| ^ markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^ markup.list.unnumbered.markdown -Paragraph break. +## https://spec.commonmark.org/0.30/#example-299 - - Unordered list item -| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - - Unordered list item #2 -| ^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item +A list may be the first block in a list item: + +1. - 2. foo 3. bar +| <- markup.list.numbered.bullet.markdown +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^ markup.list.numbered.markdown +| ^ markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^ markup.list.unnumbered.markdown +| ^^ markup.list.numbered.bullet.markdown +| ^^^^^^^^^^^^^ markup.list.numbered.markdown - punctuation -Paragraph break. +## https://spec.commonmark.org/0.30/#example-300 -- `` | `` (components/Logo.vue) -- `` | `` | (components/my-component.vue) +A list item can contain a heading: + +- # Foo | <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown +|^^^^^^^ markup.list.unnumbered.markdown +| ^^^^^^ markup.heading.1.markdown +| ^ punctuation.definition.heading.begin.markdown +| ^^^ entity.name.section.markdown -Paragraph break. - * Unordered list item -| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - + Unordered list item #2 -| ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered - markup.list.unnumbered markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - + Subitem 1 -| ^ punctuation.definition.list_item - + Item - + Subitem - + Another subitem -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - meta.paragraph.list -| ^^^^^^^^^^^^^^^ meta.paragraph.list - + Nested Subitem -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - markup.list.unnumbered markup.list.unnumbered - + Nested + Subitem -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -| ^ - punctuation.definition.list_item - - * Unsorted list item - ```xml -|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown -| ^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.begin.xml.markdown-gfm constant.other.language-name.markdown - -|^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown markup.raw.code-fence.xml.markdown-gfm text.xml meta.tag.xml - ``` -|^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +- Should be a setext heading! + --- +| ^^^ markup.list.unnumbered.markdown meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -* this is a list +- Bar + --- + baz +| <- markup.list.unnumbered.markdown +|^^^^^ markup.list.unnumbered.markdown - > This is a blockquote. -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote +## https://spec.commonmark.org/0.30/#example-301 - - this is a list - > This is a blockquote. -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote +Changing the bullet or ordered list delimiter starts a new list: + +- foo +- bar ++ baz +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-302 + +Changing the bullet or ordered list delimiter starts a new list: + +1. foo +2. bar +3) baz +| <- markup.list.numbered.bullet.markdown +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^ markup.list.numbered.markdown + +## https://spec.commonmark.org/0.30/#example-303 + +In CommonMark, a list can interrupt a paragraph. +That is, no blank line is needed to separate a paragraph from a following list: + +Foo +- bar +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown + +Foo +- bar +- baz +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown + +## https://spec.commonmark.org/0.30/#example-304 + +In order to solve of unwanted lists in paragraphs with hard-wrapped numerals, +we allow only lists starting with 1 to interrupt paragraphs. + +The number of windows in my house is +14. The number of doors is 6. +| <- meta.paragraph.markdown - markup.list +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - markup.list + +## https://spec.commonmark.org/0.30/#example-305 + +We may still get an unintended result in cases like + +The number of windows in my house is +1. The number of doors is 6. +| <- markup.list.numbered.bullet.markdown +|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown + +## https://spec.commonmark.org/0.30/#example-306 + +There can be any number of blank lines between items: + +- foo + +- bar + |^^^ markup.list.unnumbered.markdown + + +- baz + |^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-307 + +- foo + - bar + - baz + + + bim + |^^^ markup.list.unnumbered.markdown - markup.raw + +## https://spec.commonmark.org/0.30/#example-308 + +To separate consecutive lists of the same type, +you can insert a blank HTML comment: + +- foo +- bar + + +| <- meta.disable-markdown comment.block.html +|^^^^^^^ meta.disable-markdown comment.block.html + +- baz +- bim + +## https://spec.commonmark.org/0.30/#example-309 + +To separate a list from an indented code block that would otherwise +be parsed as a subparagraph of the final list item, +you can insert a blank HTML comment: + +- foo + + notcode + |^^^^^^^ markup.list.unnumbered.markdown - markup.raw + +- foo + + + + code + |^^^^ markup.raw.block.markdown - markup.list + +## https://spec.commonmark.org/0.30/#example-311 + +List items need not be indented to the same level. + +1. a + | <- markup.list.numbered.markdown - markup.raw + + 2. b + | <- markup.list.numbered.markdown - markup.raw + + 3. c + | <- markup.list.numbered.markdown - markup.raw + +1) a + | <- markup.list.numbered.markdown - markup.raw + + 2) b + | <- markup.list.numbered.markdown - markup.raw + + 3) c + | <- markup.list.numbered.markdown - markup.raw + +## https://spec.commonmark.org/0.30/#example-313 + +And here, `3. c` should be treated as in indented code block, +because it is indented four spaces and preceded by a blank line. - This is a paragraph still part of the - list item -| ^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - meta.paragraph.list meta.paragraph.list +1. a + | <- markup.list.numbered.markdown - markup.raw -* Lorem ipsum + 2. b + | <- markup.list.numbered.markdown - markup.raw - This is a code block -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered markup.raw.block -* list continues -| <- markup.list.unnumbered punctuation.definition.list_item - markup.raw.block -* list continues + 3. c + | <- markup.list.numbered.markdown - markup.raw -Paragraph break. -| <- meta.paragraph - markup +1) a + | <- markup.list.numbered.markdown - markup.raw + + 2) b + | <- markup.list.numbered.markdown - markup.raw + + 3) c + | <- markup.list.numbered.markdown - markup.raw + +> Note: ST's syntax engine and the implementation of this syntax don't support that. + +## https://spec.commonmark.org/0.30/#example-314 + +This is a loose list, because there is a blank line between two of the list items: + +- a +- b + +- c +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-315 + +So is this, with a empty second item: + +* a +* +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^ markup.list.unnumbered.markdown +* c +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^ markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-317 + +- a +- b [ref] + | ^^^^^ markup.list.unnumbered.markdown meta.link.reference.description.markdown + + [ref]: /url + | <- markup.list.unnumbered.markdown meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown + |^^^^^^^^^^^ markup.list.unnumbered.markdown meta.link.reference.def.markdown + |^^^ entity.name.reference.link.markdown + | ^ punctuation.definition.reference.end.markdown + | ^ punctuation.separator.key-value.markdown + | ^^^^ markup.underline.link.markdown +- d + | <- markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-318 + +- a +- ``` + | <- markup.list.unnumbered.markdown meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown + |^^ markup.list.unnumbered.markdown meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown + b + | <- markup.list.unnumbered.markdown markup.raw.code-fence.markdown-gfm + + + ``` + | <- markup.list.unnumbered.markdown meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + |^^ markup.list.unnumbered.markdown meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +- a +- ``` + b + + + ``` +- c + | <- markup.list.unnumbered.markdown - markup.raw + +## https://spec.commonmark.org/0.30/#example-319 + +- a + - b + + c + | <- markup.list.unnumbered.markdown +- d + | <- markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-320 + +* a + > b + > + | <- markup.list.unnumbered.markdown markup.quote.markdown punctuation.definition.blockquote.markdown + |^ markup.list.unnumbered.markdown markup.quote.markdown - punctuation + +* a + > b + > +* c + | <- markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-321 + +- a + > b + ``` + | <- markup.list.unnumbered.markdown meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown + |^^ markup.list.unnumbered.markdown meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown + c + ``` + | <- markup.list.unnumbered.markdown meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + |^^ markup.list.unnumbered.markdown meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +- a + > b + ``` + c + ``` +- d + | <- markup.list.unnumbered.markdown + +## https://spec.commonmark.org/0.30/#example-324 + +1. ``` + | <- markup.list.numbered.markdown meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown + |^^ markup.list.numbered.markdown meta.code-fence.definition.begin.text.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown + foo + | <- markup.list.numbered.markdown markup.raw.code-fence.markdown-gfm + ``` + | <- markup.list.numbered.markdown meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + |^^ markup.list.numbered.markdown meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + + bar + | <- markup.list.numbered.markdown + +## https://spec.commonmark.org/0.30/#example-325 + +* foo + * bar + + baz + | <- markup.list.unnumbered.markdown + |^^^ markup.list.unnumbered.markdown + +## https://custom-tests/list-blocks/gfm-tasks * [ ] Unticked GitHub-flavored-markdown checkbox -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered | ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm | ^ markup.checkbox.mark.markdown-gfm - punctuation | ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm + * [x] Ticked GFM checkbox | ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm | ^ markup.checkbox.mark.markdown-gfm - punctuation | ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm + * [X] Another ticked checkbox | ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm | ^ markup.checkbox.mark.markdown-gfm - punctuation | ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm + +* [X] Another ticked checkbox + [ ] Sub-item with checkbox | ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm | ^ markup.checkbox.mark.markdown-gfm - punctuation | ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm + * [] Not a checkbox -| ^^^^^^^^^^^^^^^^^ - storage - constant +| ^^ - markup.checkbox + * [/] Not a checkbox -| ^^^^^^^^^^^^^^^^^^ - storage +| ^^^ - markup.checkbox + * Not [ ] a [x] checkbox [X] -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - storage - constant +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - markup.checkbox + * [ ] [Checkbox][] with next word linked | ^ markup.checkbox.begin.markdown-gfm punctuation.definition.checkbox.begin.markdown-gfm | ^ markup.checkbox.mark.markdown-gfm - punctuation | ^ markup.checkbox.end.markdown-gfm punctuation.definition.checkbox.end.markdown-gfm | ^^^^^^^^^^^^ meta.link -* list has `unclosed code -* list continues -| ^^^^^^^^^^^^^^^ - markup.raw + +## https://custom-tests/list-blocks/items-with-thematic-breaks + +- * * * * * * * +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation + +- * * * * * * * + still a list item +| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered + +- - * * * * * * +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^ markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^ - punctuation +| ^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation + +- - * * * * * * + still a list item +| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered + +1. * * * * * * * +| <- markup.list.numbered.bullet.markdown +| ^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.separator.thematic-break.markdown +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation +| ^ punctuation.definition.thematic-break +| ^ - punctuation + +1. * * * * * * * + still a list item +| ^^^^^^^^^^^^^^^^^^ markup.list.numbered + +## https://custom-tests/list-blocks/subitems-with-second-line + +* list item +second line +| <- markup.list.unnumbered.markdown + + subitem +second line +| <- markup.list.unnumbered.markdown + - subitem +second line +| <- markup.list.unnumbered.markdown + - subitem +second line +| <- markup.list.unnumbered.markdown + +paragraph +| <- meta.paragraph.markdown + +1. list item +second line +| <- markup.list.numbered.markdown + 2. subitem +second line +| <- markup.list.numbered.markdown + 3. subitem +second line +| <- markup.list.numbered.markdown + 4. subitem +second line +| <- markup.list.numbered.markdown + +paragraph +| <- meta.paragraph.markdown + +1. list item +second line +| <- markup.list.numbered.markdown + + subitem +second line +| <- markup.list.numbered.markdown + - subitem +second line +| <- markup.list.numbered.markdown + - subitem +second line +| <- markup.list.numbered.markdown + +paragraph +| <- meta.paragraph.markdown + +## https://custom-tests/list-blocks/subitems-with-atx-headings + +* list item +# global heading +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.list +|^^^^^^^^^^^^^^^^ markup.heading.1.markdown - markup.list + +* list item + # global heading (matched as list item heading) + | <- markup.list.unnumbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.1.markdown + +* list item + # list item heading + | <- markup.list.unnumbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.1.markdown +* list item + ## list item heading + | <- markup.list.unnumbered.markdown markup.heading.2.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.2.markdown + + list item + ### list item heading + | <- markup.list.unnumbered.markdown markup.heading.3.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.3.markdown + + list item + #### list item heading + | <- markup.list.unnumbered.markdown markup.heading.4.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.4.markdown + +* + # list item heading + | <- markup.list.unnumbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.1.markdown + + + # list item heading + | <- markup.list.unnumbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.1.markdown + - + # list item heading 1 + | <- markup.list.unnumbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.1.markdown + + ## list item heading 2 + | <- markup.list.unnumbered.markdown markup.heading.2.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.2.markdown + +* + + # list item heading + | <- markup.list.unnumbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.1.markdown + + + + + # list item heading + | <- markup.list.unnumbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.1.markdown + + - + + # list item heading 1 + | <- markup.list.unnumbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.1.markdown + + ## list item heading 2 + | <- markup.list.unnumbered.markdown markup.heading.2.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown markup.heading.2.markdown + +1. list item +# global heading +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - markup.list +|^^^^^^^^^^^^^^^^ markup.heading.1.markdown - markup.list + +2. list item + # global heading (matched as list item heading) + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + +3. list item + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + 1. list item + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + 1. list item + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + 2. list item + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + 1. list item + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + +1. + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + 1. + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + 1. + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + + ## list item heading 2 + | <- markup.list.numbered.markdown markup.heading.2.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.2.markdown + +1. + + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + + 1. + + # list item heading + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + + 1. + + # list item heading 1 + | <- markup.list.numbered.markdown markup.heading.1.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.1.markdown + + ## list item heading 2 + | <- markup.list.numbered.markdown markup.heading.2.markdown punctuation.definition.heading.begin.markdown + |^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.heading.2.markdown + +## https://custom-tests/list-blocks/subitems-with-reference-definitions + +* list item [ref] + | ^^^^^ markup.list.unnumbered.markdown meta.link.reference.description.markdown + + + sub item [ref] + | ^^^^^ markup.list.unnumbered.markdown meta.link.reference.description.markdown + + [ref]: /url + | <- markup.list.unnumbered.markdown meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown + |^^^^^^^^^^^ markup.list.unnumbered.markdown meta.link.reference.def.markdown + |^^^ entity.name.reference.link.markdown + | ^ punctuation.definition.reference.end.markdown + | ^ punctuation.separator.key-value.markdown + | ^^^^ markup.underline.link.markdown + + - sub item [ref] + | ^^^^^ markup.list.unnumbered.markdown meta.link.reference.description.markdown + + [ref]: /url + | <- markup.list.unnumbered.markdown meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown + |^^^^^^^^^^^ markup.list.unnumbered.markdown meta.link.reference.def.markdown + |^^^ entity.name.reference.link.markdown + | ^ punctuation.definition.reference.end.markdown + | ^ punctuation.separator.key-value.markdown + | ^^^^ markup.underline.link.markdown + + [ref]: /url + | <- markup.list.unnumbered.markdown meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown + |^^^^^^^^^^^ markup.list.unnumbered.markdown meta.link.reference.def.markdown + |^^^ entity.name.reference.link.markdown + | ^ punctuation.definition.reference.end.markdown + | ^ punctuation.separator.key-value.markdown + | ^^^^ markup.underline.link.markdown + +1. list item [ref] + | ^^^^^ markup.list.numbered.markdown meta.link.reference.description.markdown + + 2. sub item [ref] + | ^^^^^ markup.list.numbered.markdown meta.link.reference.description.markdown + + [ref]: /url + | <- markup.list.numbered.markdown meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown + |^^^^^^^^^^^ markup.list.numbered.markdown meta.link.reference.def.markdown + |^^^ entity.name.reference.link.markdown + | ^ punctuation.definition.reference.end.markdown + | ^ punctuation.separator.key-value.markdown + | ^^^^ markup.underline.link.markdown + + 3. sub item [ref] + | ^^^^^ markup.list.numbered.markdown meta.link.reference.description.markdown + + [ref]: /url + | <- markup.list.numbered.markdown meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown + |^^^^^^^^^^^ markup.list.numbered.markdown meta.link.reference.def.markdown + |^^^ entity.name.reference.link.markdown + | ^ punctuation.definition.reference.end.markdown + | ^ punctuation.separator.key-value.markdown + | ^^^^ markup.underline.link.markdown + + [ref]: /url + | <- markup.list.numbered.markdown meta.link.reference.def.markdown punctuation.definition.reference.begin.markdown + |^^^^^^^^^^^ markup.list.numbered.markdown meta.link.reference.def.markdown + |^^^ entity.name.reference.link.markdown + | ^ punctuation.definition.reference.end.markdown + | ^ punctuation.separator.key-value.markdown + | ^^^^ markup.underline.link.markdown + +## https://custom-tests/list-blocks/subitems-with-block-quotes + +* list item + + > This is a blockquote. + | <- markup.list.unnumbered markup.quote punctuation.definition.blockquote + + + subitem + + > This is a blockquote. + | <- markup.list.unnumbered markup.quote punctuation.definition.blockquote + + - subitem + + > This is a blockquote. + | <- markup.list.unnumbered markup.quote punctuation.definition.blockquote + + - subitem + + > This is a blockquote. + | <- markup.list.unnumbered markup.quote punctuation.definition.blockquote + + This is a paragraph still part of the + list item + |^^^^^^^^^^ markup.list.unnumbered.markdown - meta.paragraph meta.paragraph + +1. list item + + > This is a blockquote. + | <- markup.list.numbered.markdown markup.quote.markdown punctuation.definition.blockquote.markdown + + 2. subitem + + > This is a blockquote. + | <- markup.list.numbered.markdown markup.quote.markdown punctuation.definition.blockquote.markdown + + 3. subitem + + > This is a blockquote. + | <- markup.list.numbered.markdown markup.quote.markdown punctuation.definition.blockquote.markdown + + This is a paragraph still part of the + list item + |^^^^^^^^^ markup.list.numbered.markdown - meta.paragraph meta.paragraph + +## https://custom-tests/list-blocks/items-with-fenced-code-blocks-indented-by-tabs + + * foo + ```xml +|^^^ markup.list.unnumbered.markdown meta.code-fence.definition.begin.xml.markdown-gfm punctuation.definition.raw.code-fence.begin.markdown +| ^^ markup.list.unnumbered.markdown meta.code-fence.definition.begin.xml.markdown-gfm constant.other.language-name.markdown + +|^^^^^ markup.list.unnumbered.markdown markup.raw.code-fence.xml.markdown-gfm text.xml meta.tag.xml + ``` +|^^^ markup.list.unnumbered.markdown meta.code-fence.definition.end.xml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + +## https://custom-tests/list-blocks/items-with-html-blocks * list item

*no-markdown*

-| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown -| ^^^^ meta.tag - - list item + |^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown - meta.paragraph + | ^^^^ meta.tag + + + sub item

*no-markdown*

-| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown -| ^^^^ meta.tag + |^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown - meta.paragraph + | ^^^^ meta.tag + + + | <- markup.list.unnumbered.markdown meta.disable-markdown meta.tag.style.end.html punctuation.definition.tag.begin.html + |^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown meta.tag.style.end.html + | ^ markup.list.unnumbered.markdown meta.disable-markdown - mata.tag + + Further sub item text. + | <- markup.list.unnumbered.markdown + |^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown + + + sub item +

+ | <- markup.list.unnumbered.markdown meta.disable-markdown meta.tag + |^^ markup.list.unnumbered.markdown meta.disable-markdown meta.tag + *no-markodwn* + |^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown - markup.italic +

+ - not a list item + | <- markup.list.unnumbered.markdown meta.disable-markdown - punctuation + |^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown - punctuation + +## https://custom-tests/list-blocks/items-with-code-spans + +- `` | `` (foo/bar.baz) +- `` | `` | (foo/bar-baz.foo) +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown - markup.table -- `code` - -| ^ markup.list.unnumbered meta.paragraph.list markup.raw.inline punctuation.definition.raw -| ^^^^^^^^^^^^^^^^^^^ meta.tag.inline.a.html - 3. [see `demo`](#demo "demo") -| ^ punctuation.definition.list_item -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline -| ^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.metadata.begin -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata.end - [see `demo`](#demo (demo)) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline -| ^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.metadata.begin -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata.end - [see `demo`](#demo 'demo') -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inline -| ^^^^^^^^^^ meta.link.inline.description -| ^ punctuation.definition.metadata.begin -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata.end - Here is a ![example image](https://test.com/sublime.png "A demonstration"). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.image.inline -| ^^ punctuation.definition.image.begin -| ^^^^^^^^^^^^^ meta.image.inline.description -| ^ punctuation.definition.image.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^^^^^^^^^^^^^^^^^ string.quoted.double -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata - Here is a ![example image](https://test.com/sublime.png 'A demonstration'). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.image.inline -| ^^ punctuation.definition.image.begin -| ^^^^^^^^^^^^^ meta.image.inline.description -| ^ punctuation.definition.image.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^^^^^^^^^^^^^^^^^ string.quoted.single -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata - Here is a ![example image](https://test.com/sublime.png (A demonstration)). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.image.inline -| ^^ punctuation.definition.image.begin -| ^^^^^^^^^^^^^ meta.image.inline.description -| ^ punctuation.definition.image.end -| ^ punctuation.definition.metadata -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^^^^^^^^^^^^^^^^^ string.quoted.other -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^ punctuation.definition.metadata +1. Open `Command Palette` using menu item `Tools → Command Palette...` + | ^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.raw.inline.markdown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.raw.inline.markdown +2. Choose `Package Control: Install Package` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown markup.raw.inline.markdown + +## https://custom-tests/list-blocks/items-with-emphasis - test *testing blah* -| ^ markup.list.unnumbered meta.paragraph.list markup.italic punctuation.definition.italic.end - meta.paragraph.list meta.paragraph.list +| ^ markup.list.unnumbered markup.italic punctuation.definition.italic.end - fgh - *ghgh -| ^ markup.list.unnumbered meta.paragraph.list markup.italic punctuation.definition.italic.begin - meta.paragraph.list meta.paragraph.list +| ^ markup.list.unnumbered markup.italic punctuation.definition.italic.begin - fgfg | <- markup.list.unnumbered.bullet punctuation.definition.list_item - _test -| <- markup.list.unnumbered meta.paragraph.list markup.italic invalid.illegal.non-terminated.bold-italic - still a list item -| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list -- * * * * * * * -| <- punctuation.definition.list_item -| ^^^^^^^^ markup.list.unnumbered meta.paragraph.list meta.separator.thematic-break - meta.paragraph.list meta.paragraph.list -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break -| ^ - punctuation.definition.thematic-break +| <- markup.list.unnumbered markup.italic invalid.illegal.non-terminated.bold-italic still a list item -| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - meta.paragraph.list meta.paragraph.list - -Paragraph break. - -1. Open `Command Palette` using menu item `Tools → Command Palette...` -|^ markup.list.numbered punctuation.definition.list_item -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list markup.raw.inline -2. Choose `Package Control: Install Package` -|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.paragraph.list.markdown markup.raw.inline.markdown +| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered -Paragraph break. - -- a - - b - - c - - d -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - text here -| ^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - markup.raw.block - meta.paragraph.list meta.paragraph.list - - code here - | ^^^^^^^^ markup.raw.block - - - e -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - - code here - - > block quote code here - | ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote - | ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered markup.quote markup.raw.block - - > > test - | ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote - | ^ markup.list.unnumbered markup.quote markup.quote punctuation.definition.blockquote - markup.raw.block - - - f -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - 1. test -| ^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item - -Paragraph break. -| <- meta.paragraph - markup - -1. test -| ^^^^^ markup.list.numbered meta.paragraph.list - - test -|^^^^^^^^^ markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -| ^^^^^ meta.paragraph.list - - test -|^^^^^^^^^ markup.list.unnumbered -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item -| ^^^^^ meta.paragraph.list - test -|^^^^^^^ markup.list.numbered meta.paragraph.list - ****test**** -|^^^^^^^^^^^^^ markup.list.numbered meta.paragraph.list - punctuation - - - - test -|^ punctuation.definition.list_item -| ^^^^^^^ markup.list.unnumbered meta.paragraph.list - punctuation -- - - - test -| <- punctuation.definition.list_item -| ^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - punctuation - -Paragraph break. -| <- meta.paragraph - markup - - * List Item 1 - Text under Item 1 - * List Item 2 - Text under Item 2 - - * List Item 3 - Text under Item 3 -| ^^^^^^^^^^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - markup.raw - - 1. fenced code block inside a list item -| ^ punctuation.definition.list_item - ```language -|^^^^^^^^^^^^^^^ meta.paragraph.list -| ^^^ punctuation.definition.raw.code-fence.begin -| ^^^^^^^^ constant.other.language-name -| ^^^^^^^^^^^ meta.code-fence - -|^^^^ meta.paragraph.list markup.raw.code-fence - ``` -| ^^^ punctuation.definition.raw.code-fence.end - test -| ^^^^^ meta.paragraph.list - markup.raw.code-fence +## https://custom-tests/list-blocks/items-with-inline-html-tags - 2. test -| ^ punctuation.definition.list_item +- `code` - +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown +| ^^^^^^ markup.raw.inline.markdown +| ^ punctuation.definition.raw.begin.markdown +| ^ punctuation.definition.raw.end.markdown +| ^ - punctuation +| ^^^^^^^^^^^^^^^^^^^ meta.tag.inline.a.html -Paragraph break. -| <- meta.paragraph - markup +- list item -1. List - 1. Nested list - 2. Second item + *no-markdown* + |^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown + | ^^^^^^^ meta.tag - This line is still list item 1 -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered - markup.raw.block + - list item + + *no-markdown* + |^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown + | ^^^^^^^ meta.tag + + - list item + + *no-markdown* + |^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.paragraph.list.markdown + | ^^^^^^^ meta.tag + +## https://custom-tests/list-blocks/items-with-links-and-references + + 1. [see `demo`](#demo "demo") + | <- markup.list.numbered.markdown meta.link.inline.description.markdown punctuation.definition.link.begin.markdown + |^^^^^^^^^^^ markup.list.numbered.markdown meta.link.inline.description.markdown + | ^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.link.inline.metadata.markdown + | ^ punctuation.definition.metadata.begin.markdown + | ^ punctuation.definition.string.begin.markdown + | ^ punctuation.definition.string.end.markdown + | ^ punctuation.definition.metadata.end.markdown -Paragraph break. -| <- meta.paragraph - markup + [see `demo`](#demo (demo)) + | <- markup.list.numbered.markdown meta.link.inline.description.markdown punctuation.definition.link.begin.markdown + |^^^^^^^^^^^ markup.list.numbered.markdown meta.link.inline.description.markdown + | ^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.link.inline.metadata.markdown + | ^ punctuation.definition.metadata.begin.markdown + | ^ punctuation.definition.string.begin.markdown + | ^ punctuation.definition.string.end.markdown + | ^ punctuation.definition.metadata.end.markdown -1. Test + [see `demo`](#demo 'demo') + | <- markup.list.numbered.markdown meta.link.inline.description.markdown punctuation.definition.link.begin.markdown + |^^^^^^^^^^^ markup.list.numbered.markdown meta.link.inline.description.markdown + | ^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.link.inline.metadata.markdown + | ^ punctuation.definition.metadata.begin.markdown + | ^ punctuation.definition.string.begin.markdown + | ^ punctuation.definition.string.end.markdown + | ^ punctuation.definition.metadata.end.markdown - ```python -| ^^^ markup.list.numbered meta.code-fence punctuation.definition.raw.code-fence.begin - Test + Here is a ![example image](https://test.com/sublime.png "A demonstration"). + | ^^^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.image.inline.description.markdown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.image.inline.metadata.markdown + | ^^ markup.list.numbered.markdown - meta.image + | ^^ punctuation.definition.image.begin.markdown + | ^ punctuation.definition.image.end.markdown + | ^ punctuation.definition.metadata.begin.markdown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown + | ^^^^^^^^^^^^^^^^^ string.quoted.double.markdown + | ^ punctuation.definition.string.begin.markdown + | ^ punctuation.definition.string.end.markdown + | ^ punctuation.definition.metadata.end.markdown -| <- - invalid - Test - ``` -| ^^^ punctuation.definition.raw.code-fence.end + Here is a ![example image](https://test.com/sublime.png 'A demonstration'). + | ^^^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.image.inline.description.markdown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.image.inline.metadata.markdown + | ^^ markup.list.numbered.markdown - meta.image + | ^^ punctuation.definition.image.begin.markdown + | ^ punctuation.definition.image.end.markdown + | ^ punctuation.definition.metadata.begin.markdown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown + | ^^^^^^^^^^^^^^^^^ string.quoted.single.markdown + | ^ punctuation.definition.string.begin.markdown + | ^ punctuation.definition.string.end.markdown + | ^ punctuation.definition.metadata.end.markdown -1. Test 2 -|^ markup.list.numbered.bullet punctuation.definition.list_item + Here is a ![example image](https://test.com/sublime.png (A demonstration)). + | ^^^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.image.inline.description.markdown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered.markdown meta.image.inline.metadata.markdown + | ^^ markup.list.numbered.markdown - meta.image + | ^^ punctuation.definition.image.begin.markdown + | ^ punctuation.definition.image.end.markdown + | ^ punctuation.definition.metadata.begin.markdown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown + | ^^^^^^^^^^^^^^^^^ string.quoted.other.markdown + | ^ punctuation.definition.string.begin.markdown + | ^ punctuation.definition.string.end.markdown + | ^ punctuation.definition.metadata.end.markdown # TEST: CODE SPANS ############################################################ From 3380e7e7e4a552a04388f75eace482dad5985da1 Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 1 Jan 2022 13:24:10 +0100 Subject: [PATCH 34/63] Syntax: Rework stacking of container blocks Lists can contain block quotes and vise versa. This commit therefore bundles both kinds of contexts in a way to make that work the best it is possible with ST's syntax engine. --- syntaxes/Markdown.sublime-syntax | 364 +++++++++------- tests/syntax_test_markdown.md | 690 +++++++++++++++++++++++++++++-- 2 files changed, 882 insertions(+), 172 deletions(-) diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 6c67b652..1c5d55f5 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -27,26 +27,8 @@ variables: block_quote: (?:[ ]{,3}(>)[ ]?) # between 0 and 3 spaces, followed by a greater than sign, (followed by any character or the end of the line = "only care about optional space!") indented_code_block: (?:[ ]{4}|[ ]{0,3}\t) # a visual tab of width 4 consisting of 4 spaces or 0 to 3 spaces followed by 1 tab + first_list_item: (?:[ ]{,3}(?:1[.)]|[*+-])\s) # between 0 and 3 spaces, followed by either: at least one integer and a full stop or a parenthesis, or (a star, plus or dash), followed by whitespace list_item: (?:[ ]{,3}(?:\d{1,9}[.)]|[*+-])\s) # between 0 and 3 spaces, followed by either: at least one integer and a full stop or a parenthesis, or (a star, plus or dash), followed by whitespace - list_item_paragraph_end: |- - \s*(?x: - $ - | {{atx_heading}} # an ATX heading begins the line - | {{block_quote}} # a blockquote begins the line - | {{fenced_code_block_start}} # a fenced codeblock begins the line - | {{thematic_break}} # line is a thematic beak - | \d{1,9}[.)]\s # an ordered list item begins the line - | [*+-]\s # an unordered list item begins the line - | \$\$ # a latex math block begins the line - | {{html_tag_block_end_at_close_tag}} # html block type 1 - | {{html_tag_block_end_at_blank_line}} # html block type 6 - | {{html_block_open_tag}} # html block type 7 - | {{html_block_close_tag}} # html block type 7 - | {{html_block_comment}} # html block type 2 - | {{html_block_decl}} # html block type 4 - | {{html_block_cdata}} # html block type 5 - | {{html_block_preprocessor}} # html block type 3 - ) thematic_break: |- (?x: @@ -174,6 +156,21 @@ variables: email_user_commonmark: '[a-zA-Z0-9.!#$%&''*+/=?^_`{|}~-]+' # https://spec.commonmark.org/0.30/#html-blocks + html_block: |- + (?x: + [ ]{,3} + (?: + \$\$ # a latex math block begins the line + | {{html_tag_block_end_at_close_tag}} # html block type 1 + | {{html_tag_block_end_at_blank_line}} # html block type 6 + | {{html_block_open_tag}} # html block type 7 + | {{html_block_close_tag}} # html block type 7 + | {{html_block_comment}} # html block type 2 + | {{html_block_decl}} # html block type 4 + | {{html_block_cdata}} # html block type 5 + | {{html_block_preprocessor}} # html block type 3 + ) + ) html_block_comment: