diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b557b655..295bff5a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,9 +105,6 @@ Here are the used scopes under 3 different markdown flavors. If you are not sure * punctuation.definition.string.end.markdown * punctuation.definition.string.markdown * punctuation.separator.key-value.markdown -* string.other.link.description.markdown -* string.other.link.description.title.markdown -* string.other.link.title.markdown ### ScopeName: text.html.markdown.gfm @@ -168,9 +165,6 @@ Here are the used scopes under 3 different markdown flavors. If you are not sure * __punctuation.definition.tag.begin.html__ * __punctuation.definition.tag.end.html__ * punctuation.separator.key-value.markdown -* string.other.link.description.markdown -* string.other.link.description.title.markdown -* string.other.link.title.markdown ### ScopeName: text.html.markdown.multimarkdown diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index 290577b1..a2e7cd0d 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -1188,7 +1188,7 @@ // jump to reference { "keys": ["f12"], "command": "mde_reference_jump", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference string.other.link", "match_all": true } + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference", "match_all": true } ] }, { "keys": ["shift+f12"], "command": "mde_reference_jump", "context": diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index 5aeeb9c5..8dbf0cb7 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -1188,7 +1188,7 @@ // jump to reference { "keys": ["f12"], "command": "mde_reference_jump", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference string.other.link", "match_all": true } + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference", "match_all": true } ] }, { "keys": ["shift+f12"], "command": "mde_reference_jump", "context": @@ -1379,31 +1379,31 @@ // Wiki // - { "keys": ["super+shift+h"], "command": "mde_open_home_page", "context": + { "keys": ["super+alt+h"], "command": "mde_open_home_page", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, { "key": "setting.mde.keymap_disable.open_home_page", "operator": "not_equal", "operand": true } ] }, - { "keys": ["super+shift+d"], "command": "mde_open_page", "context": + { "keys": ["super+alt+d"], "command": "mde_open_page", "context": [ { "key": "selector", "operator": "equal", "operand": "meta.link.reference.wiki.description.markdown", "match_all": true }, { "key": "setting.mde.keymap_disable.open_page", "operator": "not_equal", "operand": true } ] }, - { "keys": ["super+shift+d"], "command": "mde_make_page_reference", "context": + { "keys": ["super+alt+d"], "command": "mde_make_page_reference", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown - (meta.link | markup.underline.link)", "match_all": true }, { "key": "setting.mde.keymap_disable.make_page_reference", "operator": "not_equal", "operand": true } ] }, - { "keys": ["super+shift+x"], "command": "mde_list_back_links", "context": + { "keys": ["super+alt+x"], "command": "mde_list_back_links", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, { "key": "setting.mde.keymap_disable.list_back_links", "operator": "not_equal", "operand": true } ] }, - { "keys": ["super+shift+j"], "command": "mde_open_journal", "context": + { "keys": ["super+alt+j"], "command": "mde_open_journal", "context": [ { "key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }, { "key": "setting.mde.keymap_disable.open_journal", "operator": "not_equal", "operand": true } diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index 290577b1..a2e7cd0d 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -1188,7 +1188,7 @@ // jump to reference { "keys": ["f12"], "command": "mde_reference_jump", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference string.other.link", "match_all": true } + { "key": "selector", "operator": "equal", "operand": "text.html.markdown meta.link.reference", "match_all": true } ] }, { "keys": ["shift+f12"], "command": "mde_reference_jump", "context": diff --git a/Preferences.sublime-settings b/Preferences.sublime-settings index 1a8cc009..27a86b62 100644 --- a/Preferences.sublime-settings +++ b/Preferences.sublime-settings @@ -40,6 +40,16 @@ // Adds after list items instead of a single . "mde.list_align_text": false, + // MarkdownEditing (References): + // The sorting method used by the Organize References command. + // Should be one of + // + // "reference_order": List in order of appearance in document + // "alphabetical": Alphabetical based on reference name, sorting numerals lexagraphically + // "numeric": Alphabetical based on reference name, sorting numeral chunks numerically + "mde.ref_organize_sort": "reference_order", + "mde.ref_organize_sort_reverse": false, + // MarkdownEditing: // Automatically switches list bullet when indenting blank list item with . "mde.list_indent_auto_switch_bullet": true, diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index bacaa6e4..8c2e47d0 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,10 +126,16 @@ 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][]). + +* Indended code block highlighting in list blocks is not supported (see [#663][]). + ST's syntax engine can't count indentation, so reliably highlighting indended code blocks in + maybe nested list items is impossible. Use fenced code blocks instead. * 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. [#158]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues/158 +[#663]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues/663 [mdereleases]: https://github.com/SublimeText-Markdown/MarkdownEditing/releases [mdeissues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues diff --git a/docs/usage.md b/docs/usage.md index 3aa4dbbe..6068771c 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -344,7 +344,9 @@ Lastly the command to open the *home* page is provided, where the home page is j | Linux/Windows | MacOS | Description |---------------|-------|------------- -| Ctrl + Shift + H | + + H | Open home page -| Ctrl + Shift + D | + + D | Open wiki page under the cursor -| Ctrl + Shift + J | + + J | Open journal page for today -| Ctrl + Shift + B | + + B | List back links +| Ctrl + Alt + H | + + H | Open home page +| Ctrl + Alt + D | + + D | Open wiki page under the cursor +| Ctrl + Alt + J | + + J | Open journal page for today +| Ctrl + Alt + X | + + B | List back links + +_Note: The key bindings are disabled via Preferences by default to prevent conflicts with certain keyboard layouts._ diff --git a/make.cmd b/make.cmd index 30b301f6..5131e03a 100644 --- a/make.cmd +++ b/make.cmd @@ -41,7 +41,7 @@ goto :usage :LINT call :venv - black --check . + black . flake8 goto :eof 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" } diff --git a/messages/3.1.1.md b/messages/3.1.1.md new file mode 100644 index 00000000..363dfd4b --- /dev/null +++ b/messages/3.1.1.md @@ -0,0 +1,35 @@ +# MarkdownEditing 3.1.1 Changelog + +Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of +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 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) +* fix CommonMark compatibility of reference definitions +* fix CommonMark compatibility of thematic breaks +* fix `mde_convert_inline_link_to_reference` producing duplicate definitions (fixes #559) +* 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) +* fix wiki link bindings and their docs (see #679) + +## New Features + +* `Organize References` learned to sort reference definitions using `"mde.ref_organize_sort"` setting + +## Changes + +* Fully support xonsh fenced code instead of using Python syntax + (if supported syntax is installed) +* Removes indended code block highlighting from list blocks (fixes #663) + ST's syntax engine can't count indentation, so reliably highlighting + indended code blocks in maybe nested list items is impossible. + Use fenced code blocks instead. + +[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues diff --git a/plugins/references.py b/plugins/references.py index 76b87ba8..29bd0096 100644 --- a/plugins/references.py +++ b/plugins/references.py @@ -86,9 +86,35 @@ def getMarkers(view, name=""): return ids +def getReferences2(view): + """Get a dictionary of all references in the document. + Only includes real references with scope definition_scope_name, not footnotes. + + Returns: + dict: {name: link} mapping + """ + pattern = re.compile(r"\[(.+)\]:\s+(?:<([^>]+)>|(\S+))", re.MULTILINE) + + ret = {} + for definition_line in view.find_by_selector(definition_scope_name): + for reference_def in pattern.finditer(view.substr(definition_line)): + name, angled_link, unquoted_link = reference_def.groups() + assert not ret.get(name) + ret[name] = angled_link or unquoted_link + return ret + + def getReferences(view, name=""): - """Find all reference definitions.""" - # returns {name -> Region} + """Find all reference definitions. + + Args: + name (str, optional): Specific name to filter for + + Returns: + dict: {name -> Obj} mapping where Objs have a + regions attribute with a list of regions + """ + refs = [] name = re.escape(name) if name == "": @@ -109,7 +135,7 @@ def getReferences(view, name=""): def isMarkerDefined(view, name): """Return True if a marker is defined by that name.""" - return len(getReferences(view, name)) > 0 + return getReferences2(view).get(name) is not None def getCurrentScopeRegion(view, pt): @@ -286,7 +312,16 @@ def append_reference_link(edit, view, name, url): def suggest_default_link_name(name, link, image): - """Suggest default link name in camel case.""" + """Suggest default link name in camel case, if `name` is small. + + Args: + name (str): An existing name, used as a fallback + link (str): The link href + image (bool): Whether the link points to an image or not. Used for fallback. + + Returns: + str: A suggested reference name in CamelCase, or `name`. + """ ret = "" # string.punctuation minus -.:;<=>_ no_punctuation = str.maketrans("", "", "!\"#$%&'()*+,/?@[\\]^`{|}~") @@ -313,15 +348,9 @@ def suggest_default_link_name(name, link, image): def check_for_link(view, link): """Check if the link already defined. Return the name if so.""" - refs = getReferences(view) - link = link.strip() - for name in refs: - link_begin = findScopeFrom(view, refs[name].regions[0].begin(), ref_link_scope_name) - reg = getCurrentScopeRegion(view, link_begin) - found_link = view.substr(reg).strip() - if found_link == link: - return name - return None + links_by_name = getReferences2(view) + names_by_link = {v: k for k, v in links_by_name.items()} + return names_by_link.get(link) class MdeReferenceNewReferenceCommand(MdeTextCommand): @@ -522,10 +551,10 @@ def run(self, edit): # reorder markers = getMarkers(view) - marker_order = sorted( + reference_order = sorted( markers.keys(), key=lambda marker: min(markers[marker].regions, key=lambda reg: reg.a).a ) - marker_order = dict(zip(marker_order, range(0, len(marker_order)))) + reference_order = dict(zip(reference_order, range(0, len(reference_order)))) refs = getReferences(view) flatrefs = [] @@ -541,9 +570,21 @@ def run(self, edit): flatrefs.append((name, view.substr(line_reg).strip("\n"))) sel.add(line_reg) + sorting_funcs = { + "reference_order": lambda x: reference_order[x[0].lower()] + if x[0].lower() in reference_order + else 9999, + "alphabetical": lambda x: x[0].lower(), + "numeric": lambda x: [ + int(p) if p.isnumeric() else p for p in re.split(r"[ _.-]", x[0].lower()) + ], + } + settings = view.settings() + flatfns.sort(key=operator.itemgetter(0)) flatrefs.sort( - key=lambda x: marker_order[x[0].lower()] if x[0].lower() in marker_order else 9999 + key=sorting_funcs[settings.get("mde.ref_organize_sort", "reference_order")], + reverse=settings.get("mde.ref_organize_sort_reverse", False), ) view.run_command("left_delete") @@ -598,7 +639,7 @@ def run(self, edit): lower_refs = [ref.lower() for ref in refs] missings = [] for ref in refs: - if ref not in marker_order: + if ref not in reference_order: missings.append(refs[ref].label) if len(missings) > 0: if len(missings) > 1: @@ -697,11 +738,20 @@ def convert2ref(view, edit, link_span, name, omit_name=False): view.sel().add(link_span) view.show_at_center(link_span) - _viewsize = view.size() - view.insert(edit, _viewsize, "[%s]: %s\n" % (name, link)) - reference_span = sublime.Region(_viewsize + 1, _viewsize + 1 + len(name)) - view.sel().add(reference_span) - return offset + link_for_name = getReferences2(view).get(name) + if link_for_name: + if link_for_name != link: + raise Exception("Tried to insert a different link with the same name") + else: + # Skip insertion (no need, name already exists with same link) + return 0 # No insertion, no offset. + else: + _viewsize = view.size() + view.insert(edit, _viewsize, "[%s]: %s\n" % (name, link)) + reference_span = sublime.Region(_viewsize + 1, _viewsize + 1 + len(name)) + view.sel().add(reference_span) + + return offset class MdeConvertInlineLinkToReferenceCommand(MdeTextCommand): @@ -717,7 +767,7 @@ def is_visible(self): def run(self, edit, name=None): """Run command callback.""" view = self.view - pattern = r"\[([^\]]+)\]\((?!#)([^\)]+)\)" + re_link_or_embed = r"\[([^\]]+)\]\((?!#)([^\)]+)\)" # Remove all whitespace at the end of the file whitespace_at_end = view.find(r"\s*\z", 0) @@ -728,6 +778,8 @@ def run(self, edit, name=None): view.insert(edit, view.size(), "\n") link_spans = [] + links_by_name = getReferences2(view) + names_by_link = {v: k for k, v in links_by_name.items()} for sel in view.sel(): if not view.match_selector(sel.b, "meta.link.inline"): @@ -735,7 +787,7 @@ def run(self, edit, name=None): start = findScopeFrom(view, sel.b, marker_begin_scope_name, backwards=True) end = findScopeFrom(view, sel.b, marker_end_scope_name) + 1 text = view.substr(sublime.Region(start, end)) - m = re.match(pattern, text) + m = re.match(re_link_or_embed, text) if m is None: continue text = m.group(1) @@ -743,21 +795,33 @@ def run(self, edit, name=None): link_span = sublime.Region(start + m.span(2)[0] - 1, start + m.span(2)[1] + 1) if is_url(link): link = mangle_url(link) - if len(link) > 0: - if name is None: - # If link already exists, reuse existing reference - suggested_name = check_for_link(view, link) - if suggested_name is None: - is_image = view.substr(start - 1) == "!" if start > 0 else False - suggested_name = suggest_default_link_name(text, link, is_image) - - _name = name if name is not None else suggested_name - link_spans.append((link_span, _name, _name == text)) + if len(link) <= 0: + continue + # Set name based on link. + # If link already exists, reuse existing reference + name = None + if names_by_link.get(link): + name = names_by_link.get(link) + else: + # Link is not referenced. Generate name. + is_image = view.substr(start - 1) == "!" if start > 0 else False + name = name or suggest_default_link_name(text, link, is_image) + # If name is already in use by a different link, change our name. + i = 1 + name_ = name + while links_by_name.get(name, link) != link and i < 999: + i += 1 + name = name_ + str(i) + + link_spans.append((link_span, name, name == text)) + # Update local dict for batch operations + links_by_name[name] = link + names_by_link[link] = name offset = 0 - for link_span in link_spans: - _link_span = sublime.Region(link_span[0].a + offset, link_span[0].b + offset) - offset -= convert2ref(view, edit, _link_span, link_span[1], link_span[2]) + for span, name, name_is_text in link_spans: + _link_span = sublime.Region(span.a + offset, span.b + offset) + offset -= convert2ref(view, edit, _link_span, name, name_is_text) class MdeConvertInlineLinksToReferencesCommand(MdeTextCommand): @@ -838,33 +902,31 @@ class MdeReferenceCompletionsProvider(MdeViewEventListener): KIND_REFERENCE = (sublime.KIND_ID_MARKUP, "R", "Ref") re_reflinks = re.compile( - r"^\[(?P[^\^][^\]]*)\]:[ \t]+(?P\S*)(?:[ \t]+(?P.*))?$", + r"^[ \t>]*\[(?P[^\^][^\]]*)\]:\s+(?P\S*)(?:\s+(?P.*))?$", re.MULTILINE, ) - def on_query_completions(self, prefix, locations): + def on_query_completions(self, _, locations): if not self.view.match_selector( locations[0], - "text.html.markdown meta.link.reference" - " (constant.other.reference.link | punctuation.definition.constant)", + "text.html.markdown meta.link.reference, " + "text.html.markdown meta.image.reference", ): return None completions = [] for ref in self.view.find_by_selector("meta.link.reference.def"): - match = self.re_reflinks.match(self.view.substr(ref)) - if not match: - continue - completions.append( - sublime.CompletionItem( - trigger=match.group("id"), - completion=match.group("id"), - completion_format=sublime.COMPLETION_FORMAT_TEXT, - kind=self.KIND_REFERENCE, - annotation=shorten((match.group("link") or "No link"), 30), - details=(match.group("desc") or "No title").strip(" \t\v\f\r\n'\""), + for match in self.re_reflinks.finditer(self.view.substr(ref)): + completions.append( + sublime.CompletionItem( + trigger=match.group("id"), + completion=match.group("id"), + completion_format=sublime.COMPLETION_FORMAT_TEXT, + kind=self.KIND_REFERENCE, + annotation=shorten((match.group("link") or "No link"), 30), + details=(match.group("desc") or "No title").strip(" \t\v\f\r\n'\""), + ) ) - ) return sublime.CompletionList( completions, sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS, @@ -875,26 +937,31 @@ def on_query_completions(self, prefix, locations): class MdeReferenceCompletionsProvider(MdeViewEventListener): re_reflinks = re.compile( - r"^\[(?P[^\^][^\]]*)\]:[ \t]+(?P\S*)(?:[ \t]+(?P.*))?$", + r"^[ \t>]*\[(?P[^\^][^\]]*)\]:\s+(?P\S*)(?:\s+(?P.*))?$", re.MULTILINE, ) - def on_query_completions(self, prefix, locations): + def on_query_completions(self, _, locations): if not self.view.match_selector( locations[0], - "text.html.markdown meta.link.reference" - " (constant.other.reference.link | punctuation.definition.constant)", + "text.html.markdown meta.link.reference, " + "text.html.markdown meta.image.reference", ): return None completions = [] for ref in self.view.find_by_selector("meta.link.reference.def"): - match = self.re_reflinks.match(self.view.substr(ref)) - if not match: - continue - completions.append(match.group("id")) + for match in self.re_reflinks.finditer(self.view.substr(ref)): + completions.append( + [ + match.group("id") + + "\t" + + shorten((match.group("link") or "No link"), 30), + match.group("id"), + ] + ) - return [ + return ( completions, sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS, - ] + ) diff --git a/plugins/view.py b/plugins/view.py index 109be4e9..74dc097f 100644 --- a/plugins/view.py +++ b/plugins/view.py @@ -107,3 +107,12 @@ def on_modified(self): if self.current_line != current_line: self.current_line = current_line self.view.show_at_center(pt) + + +def find_by_selector_in_regions(view, regions, selector): + selectors = [] + for sel in view.find_by_selector(selector): + if any(s.intersects(sel) for s in regions): + selectors.append(sel) + + return selectors diff --git a/schemes/Mariana.sublime-color-scheme b/schemes/Mariana.sublime-color-scheme index d5f65a2a..e3b1dd2b 100644 --- a/schemes/Mariana.sublime-color-scheme +++ b/schemes/Mariana.sublime-color-scheme @@ -10,67 +10,66 @@ // Basic Formattings { - "name": "Bold Content", + "name": "Markdown: Bold Content", "scope": "text.html.markdown markup.bold - punctuation.definition.bold", "font_style": "bold" }, { - "name": "Bold Punctuation", + "name": "Markdown: Bold Punctuation", "scope": "text.html.markdown punctuation.definition.bold", "font_style": "" }, { - "name": "Italic Content", + "name": "Markdown: Italic Content", "scope": "text.html.markdown markup.italic - punctuation.definition.italic", "font_style": "italic" }, { - "name": "Italic Punctuation", + "name": "Markdown: Italic Punctuation", "scope": "text.html.markdown punctuation.definition.italic", "font_style": "" }, { - "name": "Bold Italic Content", + "name": "Markdown: Bold Italic Content", "scope": "text.html.markdown markup.bold markup.italic - punctuation.definition.bold - punctuation.definition.italic, text.html.markdown markup.bold_italic - punctuation.definition.bold", "font_style": "bold italic" }, { - "name": "Underlined Content", + "name": "Markdown: Underlined Content", "scope": "text.html.markdown markup.underline", "font_style": "underline" }, { - "name": "Bold Underlined Content", + "name": "Markdown: Bold Underlined Content", "scope": "text.html.markdown & markup.bold & markup.underline - punctuation.definition.bold", "font_style": "bold underline" }, { - "name": "Italic Underlined Content", + "name": "Markdown: Italic Underlined Content", "scope": "text.html.markdown & markup.italic & markup.underline - punctuation.definition.italic", "font_style": "italic underline" }, { - "name": "Bold Italic Underlined Content", + "name": "Markdown: Bold Italic Underlined Content", "scope": "text.html.markdown & markup.bold & markup.italic & markup.underline - punctuation.definition.bold - punctuation.definition.italic", "font_style": "bold underline" }, { - "name": "Striked Content", - "scope": "text.html.markdown markup.strikethrough", - "foreground": "var(grey)", + "name": "Markdown: Striked Content", + "scope": "text.html.markdown markup.strikethrough, text.html.markdown markup.strikethrough string", + "foreground": "var(blue4)", "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": "Markdown: 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(blue2)", "font_style": "" }, { - "name": "Striked Strings", - "scope": "text.html.markdown markup.strikethrough string", - "foreground": "var(grey)", - "font_style": "" + "name": "Markdown: Striked URLs", + "scope": "text.html.markdown markup.strikethrough & (markup.underline.link.markdown | markup.underline.link.image.markdown)", + "foreground": "var(blue4)" }, { "name": "Markdown: Hard Line Breaks", @@ -80,7 +79,7 @@ // Block Quotes { - "name": "Block Quotes", + "name": "Markdown: Block Quotes", "scope": "text.html.markdown markup.quote punctuation.definition.blockquote, text.html.markdown markup.quote punctuation.definition.quote", "foreground": "var(blue2)", "background": "var(blue2)" @@ -88,13 +87,13 @@ // Code Blocks { - "name": "Inline Code Block", + "name": "Markdown: Inline Code Block", "scope": "text.html.markdown markup.raw.inline", "foreground": "var(raw_fg)", "background": "var(raw_bg)" }, { - "name": "Raw Code Block", + "name": "Markdown: Raw Code Block", "scope": "text.html.markdown markup.raw, text.html.markdown meta.code-fence", "foreground": "var(raw_fg)", "background": "var(raw_bg)" @@ -102,36 +101,41 @@ // Inline References { - "name": "Inline Link URL", + "name": "Markdown: Link Description", + "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 - markup.strikethrough", + "foreground": "var(blue)" + }, + { + "name": "Markdown: Inline Link URL", "scope": "text.html.markdown meta.link.inline markup.underline.link", "foreground": "var(pink)" }, // Keyboard Shortcuts { - "name": "Keyboard Shortcut Background", + "name": "Markdown: Keyboard Shortcut Background", "scope": "text.html.markdown markup.kbd", "background": "var(raw_bg)" }, { - "name": "Keyboard Shortcut Tags", + "name": "Markdown: Keyboard Shortcut Tags", "scope": "text.html.markdown markup.kbd entity.name.tag, text.html.markdown markup.kbd punctuation.definition.tag", "foreground": "var(raw_fg)" }, { - "name": "Keyboard Shortcut Content", + "name": "Markdown: Keyboard Shortcut Content", "scope": "text.html.markdow markup.kbd.content", "foreground": "var(blue)" }, // Tables { - "name": "Table Separators / Lines", + "name": "Markdown: Table Separators / Lines", "scope": "text.html.markdown meta.table.header-separator punctuation.section, text.html.markdown punctuation.section.table-header, text.html.markdown punctuation.separator.table-cell", "foreground": "var(blue4)" }, { - "name": "Table Cell Content Alignment Operator", + "name": "Markdown: Table Cell Content Alignment Operator", "scope": "text.html.markdown meta.table.header-separator punctuation.definition", "foreground": "var(pink)" } diff --git a/schemes/MarkdownEditor-ArcDark.sublime-color-scheme b/schemes/MarkdownEditor-ArcDark.sublime-color-scheme index a5194836..137fd3c1 100644 --- a/schemes/MarkdownEditor-ArcDark.sublime-color-scheme +++ b/schemes/MarkdownEditor-ArcDark.sublime-color-scheme @@ -257,7 +257,7 @@ }, { "name": "Markdown: Link Description", - "scope": "meta.link.inline.description, meta.link.reference.description, meta.image.reference.description", + "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 - markup.strikethrough", "foreground": "#5294E2" }, { diff --git a/schemes/MarkdownEditor-Dark.sublime-color-scheme b/schemes/MarkdownEditor-Dark.sublime-color-scheme index 2e10ae77..16f33ffa 100644 --- a/schemes/MarkdownEditor-Dark.sublime-color-scheme +++ b/schemes/MarkdownEditor-Dark.sublime-color-scheme @@ -264,7 +264,7 @@ }, { "name": "Markdown: Link Description", - "scope": "meta.link.inline.description, meta.link.reference.description, meta.image.reference.description", + "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 - markup.strikethrough", "foreground": "#cccccc" }, { diff --git a/schemes/MarkdownEditor-Focus.sublime-color-scheme b/schemes/MarkdownEditor-Focus.sublime-color-scheme index 1ccf2d83..1fb80e1c 100644 --- a/schemes/MarkdownEditor-Focus.sublime-color-scheme +++ b/schemes/MarkdownEditor-Focus.sublime-color-scheme @@ -286,7 +286,7 @@ }, { "name": "Markdown: Link Description", - "scope": "meta.link.inline.description, meta.link.reference.description, meta.image.reference.description", + "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 - markup.strikethrough", "foreground": "#333333" }, { diff --git a/schemes/MarkdownEditor-Yellow.sublime-color-scheme b/schemes/MarkdownEditor-Yellow.sublime-color-scheme index 8748ddbe..71f32eef 100644 --- a/schemes/MarkdownEditor-Yellow.sublime-color-scheme +++ b/schemes/MarkdownEditor-Yellow.sublime-color-scheme @@ -263,7 +263,7 @@ }, { "name": "Markdown: Link Description", - "scope": "meta.link.inline.description, meta.link.reference.description, meta.image.reference.description", + "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 - markup.strikethrough", "foreground": "#533228" }, { diff --git a/schemes/MarkdownEditor.sublime-color-scheme b/schemes/MarkdownEditor.sublime-color-scheme index 9c001f26..b6cb2669 100644 --- a/schemes/MarkdownEditor.sublime-color-scheme +++ b/schemes/MarkdownEditor.sublime-color-scheme @@ -263,7 +263,7 @@ }, { "name": "Markdown: Link Description", - "scope": "meta.link.inline.description, meta.link.reference.description, meta.image.reference.description", + "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 - markup.strikethrough", "foreground": "#333333" }, { diff --git a/schemes/Monokai.sublime-color-scheme b/schemes/Monokai.sublime-color-scheme index c70e9ab2..4f3684fd 100644 --- a/schemes/Monokai.sublime-color-scheme +++ b/schemes/Monokai.sublime-color-scheme @@ -10,67 +10,66 @@ // Basic Formattings { - "name": "Bold Content", + "name": "Markdown: Bold Content", "scope": "text.html.markdown markup.bold - punctuation.definition.bold", "font_style": "bold" }, { - "name": "Bold Punctuation", + "name": "Markdown: Bold Punctuation", "scope": "text.html.markdown punctuation.definition.bold", "font_style": "" }, { - "name": "Italic Content", + "name": "Markdown: Italic Content", "scope": "text.html.markdown markup.italic - punctuation.definition.italic", "font_style": "italic" }, { - "name": "Italic Punctuation", + "name": "Markdown: Italic Punctuation", "scope": "text.html.markdown punctuation.definition.italic", "font_style": "" }, { - "name": "Bold Italic Content", + "name": "Markdown: Bold Italic Content", "scope": "text.html.markdown markup.bold markup.italic - punctuation.definition.bold - punctuation.definition.italic, text.html.markdown markup.bold_italic - punctuation.definition.bold", "font_style": "bold italic" }, { - "name": "Underlined Content", + "name": "Markdown: Underlined Content", "scope": "text.html.markdown markup.underline", "font_style": "underline" }, { - "name": "Bold Underlined Content", + "name": "Markdown: Bold Underlined Content", "scope": "text.html.markdown & markup.bold & markup.underline - punctuation.definition.bold", "font_style": "bold underline" }, { - "name": "Italic Underlined Content", + "name": "Markdown: Italic Underlined Content", "scope": "text.html.markdown & markup.italic & markup.underline - punctuation.definition.italic", "font_style": "italic underline" }, { - "name": "Bold Italic Underlined Content", + "name": "Markdown: Bold Italic Underlined Content", "scope": "text.html.markdown & markup.bold & markup.italic & markup.underline - punctuation.definition.bold - punctuation.definition.italic", "font_style": "bold underline" }, { - "name": "Striked Content", - "scope": "text.html.markdown markup.strikethrough", + "name": "Markdown: Striked Content", + "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": "Markdown: 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 | punctuation.definition.bold | punctuation.definition.italic | punctuation.definition.string)", "foreground": "var(grey)", "font_style": "" }, { - "name": "Striked Strings", - "scope": "text.html.markdown markup.strikethrough string", - "foreground": "var(grey)", - "font_style": "" + "name": "Markdown: 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", @@ -80,7 +79,7 @@ // Block Quotes { - "name": "Block Quotes", + "name": "Markdown: Block Quotes", "scope": "text.html.markdown markup.quote punctuation.definition.blockquote, text.html.markdown markup.quote punctuation.definition.quote", "foreground": "var(grey)", "background": "var(grey)" @@ -88,13 +87,13 @@ // Code Blocks { - "name": "Inline Code Block", + "name": "Markdown: Inline Code Block", "scope": "text.html.markdown markup.raw.inline", "foreground": "var(raw_fg)", "background": "var(raw_bg)" }, { - "name": "Raw Code Block", + "name": "Markdown: Raw Code Block", "scope": "text.html.markdown markup.raw, text.html.markdown meta.code-fence", "foreground": "var(raw_fg)", "background": "var(raw_bg)" @@ -102,36 +101,41 @@ // Inline References { - "name": "Inline Link URL", + "name": "Markdown: Link Description", + "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 - markup.strikethrough", + "foreground": "var(yellow)" + }, + { + "name": "Markdown: Inline Link URL", "scope": "text.html.markdown meta.link.inline markup.underline.link", "foreground": "var(blue)" }, // Keyboard Shortcuts { - "name": "Keyboard Shortcut Background", + "name": "Markdown: Keyboard Shortcut Background", "scope": "text.html.markdown markup.kbd", "background": "var(raw_bg)" }, { - "name": "Keyboard Shortcut Tags", + "name": "Markdown: Keyboard Shortcut Tags", "scope": "text.html.markdown markup.kbd entity.name.tag, text.html.markdown markup.kbd punctuation.definition.tag", "foreground": "var(raw_fg)" }, { - "name": "Keyboard Shortcut Content", + "name": "Markdown: Keyboard Shortcut Content", "scope": "text.html.markdow markup.kbd.content", "foreground": "var(blue)" }, // Tables { - "name": "Table Separators / Lines", + "name": "Markdown: Table Separators / Lines", "scope": "text.html.markdown meta.table.header-separator punctuation.section, text.html.markdown punctuation.section.table-header, text.html.markdown punctuation.separator.table-cell", "foreground": "var(grey)" }, { - "name": "Table Cell Content Alignment Operator", + "name": "Markdown: Table Cell Content Alignment Operator", "scope": "text.html.markdown meta.table.header-separator punctuation.definition", "foreground": "var(red2)" } diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index e4ce9a15..fc2ffa7b 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -19,204 +19,258 @@ file_extensions: - markdn variables: - atx_heading: (?:[ ]{,3}[#]{1,6}(?:[ \t]|$)) # between 0 and 3 spaces, followed 1 to 6 hashes, followed by at least one space or tab or by end of the line - atx_heading_space: (?:(?=[ \t]+#+[ \t]*$)|[ \t]+|$) # consume spaces only if heading is not empty to ensure `atx_heading_end` can fully match closing hashes - atx_heading_end: (?:[ \t]+(#+))?[ \t]*($\n?) # \n is optional so ## is matched as end punctuation in new document (at eof) - 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 - 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: - [ ]{,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]*$ # followed by any number of tabs or spaces, followed by the end of the line - ) - - backticks: |- - (?x: - (`{4})(?![\s`])(?:[^`]+(?=`)|(?!`{4})`+(?!`))+(`{4})(?!`) # 4 backticks, followed by at least one non whitespace, non backtick character, followed by (less than 4 backticks, or at least one non backtick character) at least once, followed by exactly 4 backticks - | (`{3})(?![\s`])(?:[^`]+(?=`)|(?!`{3})`+(?!`))+(`{3})(?!`) # 3 backticks, followed by at least one non whitespace, non backtick character, followed by (less than 3 backticks, or at least one non backtick character) at least once, followed by exactly 3 backticks - | (`{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 + atx_heading: (?:[ ]{,3}[#]{1,6}(?:[ \t]|$)) # between 0 and 3 spaces, followed 1 to 6 hashes, followed by at least one space or tab or by end of the line + atx_heading_space: (?:(?=[ \t]+#+[ \t]*$)|[ \t]+|$) # consume spaces only if heading is not empty to ensure `atx_heading_end` can fully match closing hashes + atx_heading_end: (?:[ \t]+(#+))?[ \t]*($\n?) # \n is optional so ## is matched as end punctuation in new document (at eof) + 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}|[ ]{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 + + thematic_break: |- + (?x: + [ ]{,3} # between 0 to 3 spaces + (?: # followed by one of the following: + [-](?:[ \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 ) - escape: \\[-`*_#+.!(){}\[\]\\>|~<] - - balance_square_brackets: |- - (?x: - (?: - {{escape}}+ # 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) - [^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick - {{backticks}}? # balanced backticks - )*\] # closing square bracket - )+ + [ \t]*$ # followed by any number of tabs or spaces, followed by the end of the line + ) + + backticks: |- + (?x: + (`{4})(?![\s`])(?:[^`]+(?=`)|(?!`{4})`+(?!`))+(`{4})(?!`) # 4 backticks, followed by at least one non whitespace, non backtick character, followed by (less than 4 backticks, or at least one non backtick character) at least once, followed by exactly 4 backticks + | (`{3})(?![\s`])(?:[^`]+(?=`)|(?!`{3})`+(?!`))+(`{3})(?!`) # 3 backticks, followed by at least one non whitespace, non backtick character, followed by (less than 3 backticks, or at least one non backtick character) at least once, followed by exactly 3 backticks + | (`{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 + ) + escapes: \\[-+*/!"#$%&'(),.:;<=>?@\[\\\]^_`{|}~] + + balance_square_brackets: |- + (?x: + (?: + (?:{{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) + [^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick + {{backticks}}? # balanced backticks + )*\] # closing square bracket + )+ + ) + balance_square_brackets_and_emphasis: |- + (?x: + (?: + (?:{{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) + [^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick + {{backticks}}? # balanced backticks + )*\] # closing square bracket + )+ # at least one character + ) + balance_square_brackets_pipes_and_emphasis: |- + (?x: + (?: + (?:{{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) + [^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick + {{backticks}}? # balanced backticks + )*\] # closing square bracket + )+ # at least one character + ) + balanced_emphasis: |- + (?x: + \* (?!\*){{balance_square_brackets_and_emphasis}}+\* (?!\*) + | \*\* {{balance_square_brackets_and_emphasis}}+\*\* + | _ (?!_) {{balance_square_brackets_and_emphasis}}+_ (?!_) + | __ {{balance_square_brackets_and_emphasis}}+__ + ) + + table_cell: |- + (?x: + # Pipes inside other inline spans (such as emphasis, code, etc.) will not break a cell, + # emphasis in table cells can't span multiple lines + (?: + {{balance_square_brackets_pipes_and_emphasis}} + | {{balanced_emphasis}} + )+ # at least one character + ) + table_first_row: |- + (?x: + # at least 2 non-escaped pipe chars on the line + (?:{{table_cell}}?\|){2} + + # something other than whitespace followed by a pipe char or hyphon, + # followed by something other than whitespace and the end of the line + | (?! \s*\-\s+ | \s+\|){{table_cell}}\|(?!\s+$) + ) + + fenced_code_block_start: |- + (?x: + ([ \t]*) + ( + (`){3,} # 3 or more backticks + (?![^`]*`) # not followed by any more backticks on the same line + | # or + (~){3,} # 3 or more tildas ) - balance_square_brackets_and_emphasis: |- - (?x: - (?: - {{escape}}+ # 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) - [^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick - {{backticks}}? # balanced backticks - )*\] # closing square bracket - )+ # at least one character + \s* # allow for whitespace between code block start and info string + ) + fenced_code_block_language: |- + (?x: # first word of an infostring is used as language specifier + ( + [[:alpha:]] # starts with a letter to make sure not to hit any attribute annotation + [^`\s]* # optionally followed by any nonwhitespace character (except backticks) ) - balance_square_brackets_pipes_and_emphasis: |- - (?x: - (?: - {{escape}}+ # 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) - [^\[\]`]+(?=[\[\]`]) # anything that isn't a square bracket or a backtick - {{backticks}}? # balanced backticks - )*\] # closing square bracket - )+ # at least one character + ) + fenced_code_block_trailing_infostring_characters: |- + (?x: + ( + \s* # any whitespace, or .. + | + \s[^`]* # any characters (except backticks), separated by whitespace ... ) - balanced_emphasis: |- - (?x: - \* (?!\*){{balance_square_brackets_and_emphasis}}+\* (?!\*) - | \*\* {{balance_square_brackets_and_emphasis}}+\*\* - | _ (?!_) {{balance_square_brackets_and_emphasis}}+_ (?!_) - | __ {{balance_square_brackets_and_emphasis}}+__ + $\n? # ... until EOL + ) + fenced_code_block_end: |- + (?x: + [ \t]* + ( + \2 # the backtick/tilde combination that opened the code fence + (?:\3|\4)* # plus optional additional closing characters ) + \s*$ # any amount of whitespace until EOL + ) + fenced_code_block_escape: ^{{fenced_code_block_end}} - table_cell: |- - (?x: - # Pipes inside other inline spans (such as emphasis, code, etc.) will not break a cell, - # emphasis in table cells can't span multiple lines - (?: - {{balance_square_brackets_pipes_and_emphasis}} - | {{balanced_emphasis}} - )+ # at least one character - ) - table_first_row: |- - (?x: - # at least 2 non-escaped pipe chars on the line - (?:{{table_cell}}?\|){2} - - # something other than whitespace followed by a pipe char or hyphon, - # followed by something other than whitespace and the end of the line - | (?! \s*\-\s+ | \s+\|){{table_cell}}\|(?!\s+$) - ) - - fenced_code_block_start: |- - (?x: - ([ \t]*) - ( - (`){3,} # 3 or more backticks - (?![^`]*`) # 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 - ) - fenced_code_block_language: |- - (?x: # first word of an infostring is used as language specifier - ( - [[:alpha:]] # starts with a letter to make sure not to hit any attribute annotation - [^`\s]* # optionally followed by any nonwhitespace character (except backticks) - ) - ) - fenced_code_block_trailing_infostring_characters: |- - (?x: - ( - \s* # any whitespace, or .. - | - \s[^`]* # any characters (except backticks), separated by whitespace ... - ) - $\n? # ... until EOL - ) - fenced_code_block_end: |- - (?x: - [ \t]* - ( - \2 # the backtick/tilde combination that opened the code fence - (?:\3|\4)* # plus optional additional closing characters - ) - \s*$ # any amount of whitespace until EOL - ) - fenced_code_block_escape: ^{{fenced_code_block_end}} + # https://spec.commonmark.org/0.30/#email-autolink + email_domain_commonmark: '[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?' + email_user_commonmark: '[a-zA-Z0-9.!#$%&''*+/=?^_`{|}~-]+' - # https://spec.commonmark.org/0.30/#email-autolink - email_domain_commonmark: '[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?' - email_user_commonmark: '[a-zA-Z0-9.!#$%&''*+/=?^_`{|}~-]+' - - # https://spec.commonmark.org/0.30/#html-blocks - html_block_comment: ---> ----> >-> >--> >---> >----> +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - Foo - --- -|^^^^^^^ markup.raw.block.markdown +these are raw ligatures >- >-- >--- >---- ----< ---< --< -< +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag - Foo ---- -| <- meta.separator.thematic-break.markdown - markup.heading -|^^^ meta.separator.thematic-break.markdown - markup.heading +these are raw ligatures >< >-< >--< >---< <---> <--> <-> <> +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag -https://spec.commonmark.org/0.30/#example-86 +these are raw ligatures <= <== <=== <==== <=< <==< <===< <====< +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag -Foo - ---- -|^^^^^^^^^^^^^ markup.heading.2.markdown -|^^ - punctuation -| ^^^^ punctuation.definition.heading.setext.markdown -| ^^^^^^^ - punctuation -| ^ meta.whitespace.newline.markdown +these are raw ligatures => ==> ===> ====> >=> >==> >===> >====> +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag -https://spec.commonmark.org/0.30/#example-87 +these are raw ligatures >= >== >=== >==== ====< ===< ==< =< +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag -Foo - --- -| <- meta.paragraph.markdown - markup.heading -|^^^^^^^ meta.paragraph.markdown - markup.heading +these are raw ligatures >< >=< >==< >===< <===> <==> <=> <> +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag -https://spec.commonmark.org/0.30/#example-88 +these are raw ligatures - -- --- ---- ----- ===== ==== === == = +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag -Foo -= = -| <- meta.paragraph.markdown - markup.heading -|^^^ meta.paragraph.markdown - markup.heading +-= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable -Foo ---- - -| <- meta.separator.thematic-break.markdown - markup.heading -|^^^^^ meta.separator.thematic-break.markdown - markup.heading + -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw - constant - keyword - variable - punctuation -https://spec.commonmark.org/0.30/#example-89 +> -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable -Foo -| ^^ markup.heading.2.markdown entity.name.section.markdown - meta.hard-line-break ------ -| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown -|^^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +> > -= += /= %= -- ++ ** !~ =~ ~~ <= >= => <=> // && == != +| ^ markup.quote.markdown punctuation.definition.blockquote.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - constant - keyword - variable -https://spec.commonmark.org/0.30/#example-90 -Foo\ -| ^ markup.heading.2.markdown entity.name.section.markdown - meta.hard-line-break ----- -| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown -|^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +# TEST: BACKSLASH ESCAPES ##################################################### -https://spec.commonmark.org/0.30/#example-91 +## https://spec.commonmark.org/0.30/#example-12 -`Foo ----- -| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown -|^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ +| <- constant.character.escape.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.character.escape.markdown -`Foo` ----- -| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown -|^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +## https://spec.commonmark.org/0.30/#example-13 -https://spec.commonmark.org/0.30/#example-92 +\ \A\a\ \3\φ\« +| <- - constant.character.escape +|^^^^^^^^^^^^^ - constant.character.escape -> Foo ---- -| <- meta.separator.thematic-break.markdown - markup.heading -|^^^ meta.separator.thematic-break.markdown - markup.heading +## https://spec.commonmark.org/0.30/#example-14 -https://spec.commonmark.org/0.30/#example-93 +\*not emphasized* +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^^^^^ - markup.italic -> foo -bar -=== -| <- markup.quote.markdown - markup.heading -|^^^ markup.quote.markdown - markup.heading +\
not a tag +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^ - markup.tag -https://spec.commonmark.org/0.30/#example-94 -- Foo ---- -| <- meta.separator.thematic-break.markdown - markup.heading -|^^^ meta.separator.thematic-break.markdown - markup.heading +\
not a tag +| <- constant.character.escape.markdown +|^^^^^^ - meta.tag +| ^^ constant.character.escape -https://spec.commonmark.org/0.30/#example-95 +\[not a link](/foo) +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^^^^^^^ - markup.link -Foo -Bar ---- -| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown -|^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +\`not code` +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^ - markup.raw -https://spec.commonmark.org/0.30/#example-96 +1\. not a list +|^^ constant.character.escape.markdown +|^^^^^^^^^^^^^ - markup.list ---- -Foo ---- -| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown -|^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +\* not a list +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^ - markup.list ---- -Foo ---- -Bar ---- -| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown -|^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown -Baz +\# not a heading +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^^^^ - markup.heading ---- -Foo ---- -Bar ---- -Baz -| <- meta.paragraph.markdown -|^^^ meta.paragraph.markdown +\[foo]: /url "not a reference" +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.link -https://spec.commonmark.org/0.30/#example-97 +\ö not a character entity +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +|^^^^^^ - entity -==== -| <- meta.paragraph.markdown -|^^^^ meta.paragraph.markdown +\~/.bashrc +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown -https://spec.commonmark.org/0.30/#example-98 +## https://spec.commonmark.org/0.30/#example-15 ---- ---- -| <- meta.separator.thematic-break.markdown - markup.heading -|^^^ meta.separator.thematic-break.markdown - markup.heading +\\*emphasis* +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +| ^^^^^^^^^^ markup.italic.markdown -https://spec.commonmark.org/0.30/#example-102 +\\_emphasis_ +| <- constant.character.escape.markdown +|^ constant.character.escape.markdown +| ^^^^^^^^^^ markup.italic.markdown -\> foo ------- -| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown -|^^^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +## https://spec.commonmark.org/0.30/#example-16 -``` -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 +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 -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 +`` \[\` `` +|^^^^^^^^^ markup.raw.inline.markdown - constant.character.escape -Inline `code sample`. -| ^^^^^^^^^^^^^ markup.raw.inline -| ^ punctuation.definition.raw -| ^ punctuation.definition.raw +## https://spec.commonmark.org/0.30/#example-18 -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 + \[\] +|^^^^^^^^ markup.raw.block.markdown - constant.character.escape -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.30/#example-19 -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 +~~~ +\[\] +|^^^^ markup.raw.code-fence.markdown-gfm - constant.character.escape +~~~ -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.30/#example-20 -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 + +| ^^ - constant.character.escape -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 +## https://spec.commonmark.org/0.30/#example-21 -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 + +| ^^ - constant.character.escape -Not a [link] (url) due to space. -| ^^^^^^ meta.link.reference.description.markdown -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link +## https://spec.commonmark.org/0.30/#example-22 -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 +[foo](/bar\* "ti\*tle") +| ^^ markup.underline.link.markdown constant.character.escape +| ^^ constant.character.escape -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 +## https://spec.commonmark.org/0.30/#example-23 -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 +[foo] -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 +[foo]: /bar\* "ti\*tle" +| ^^ markup.underline.link.markdown constant.character.escape +| ^^ constant.character.escape -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.30/#example-24 -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 +Note: current design doesn't support highlighting escapes in info strings +``` foo\+bar +| ^^ - constant.character.escape +foo +``` -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: HTML ENTITIES ######################################################### -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-25 -Here is a ![Image Alt Text]( - https://example.com/cat.gif ). -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.underline.link.image.markdown -| ^ punctuation.definition.metadata.end.markdown +   & © Æ Ď +| ^^^^^^ 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 -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 +## https://spec.commonmark.org/0.30/#example-28 -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 + & +| ^ - constant - invalid -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 +   &x; &#; &#x; +| ^^^^^^ - constant +| ^^^ constant.character.entity.named.html +| ^^^^^^^^^ - constant -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 + &#abcdef0; +| ^^^^^^^^^^ - constant -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 + &hi?; +| ^^^^^ - constant - 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 +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. -Paragraph break. +## https://spec.commonmark.org/0.30/#example-29 -- `` | `` (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 +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: -Paragraph break. + © +| ^^^^^ - constant - * 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 +## https://spec.commonmark.org/0.30/#example-30 -Paragraph break. +Strings that are not on the list of HTML5 named entities are not recognized as +entity references either: -> This is a block quote. It contains markup. -> Including things like *italics* -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote -| ^^^^^^^^^ markup.italic + &MadeUpEntity; +| ^^^^^^^^^^^^^^ constant.character.entity.named.html -Paragraph break. +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. ---- -|^^^ meta.separator.thematic-break -|^^ punctuation.definition.thematic-break +## https://spec.commonmark.org/0.30/#example-31 -Paragraph break. + +| ^^^^^^^^^^^^ constant.character.entity.named.html --------- -|^^^^^^^^ meta.separator.thematic-break -|^^^^^^^ punctuation.definition.thematic-break +## https://spec.commonmark.org/0.30/#example-32 -[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](/föö "föö") +| ^^^^^^^^^^^^ constant.character.entity.named.html +| ^^^^^^^^^^^^ constant.character.entity.named.html -
this is HTML until there are two blank lines
-| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -disabled markdown -| <- meta.disable-markdown +## https://spec.commonmark.org/0.30/#example-33 -non-disabled markdown -| <- - meta.disable-markdown +[foo] -
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]: /föö "föö" +| ^^^^^^^^^^^^ constant.character.entity.named.html +| ^^^^^^^^^^^^ constant.character.entity.named.html -non-disabled markdown -| <- - meta.disable-markdown +## https://spec.commonmark.org/0.30/#example-34 -
nested tags don't count 
test
-| ^^^^^^ meta.disable-markdown meta.tag.block.any.html -non-disabled markdown -| <- - meta.disable-markdown +``` föö +foo +``` +Note: current design doesn't support highlighting entities in info strings -
nested tags don't count
test -| ^^^^^ meta.disable-markdown -
-| ^^^ meta.disable-markdown entity.name.tag.block.any.html +## https://spec.commonmark.org/0.30/#example-35 -non-disabled markdown -| <- - meta.disable-markdown +`föö` +|^^^^^^^^^^^^^ - constant.character.entity -
two blank lines needed
to stop disabled markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -disabled markdown -| <- meta.disable-markdown +## https://spec.commonmark.org/0.30/#example-36 -non-disabled markdown -| <- - meta.disable-markdown + föfö +| ^^^^^^^^^^^^^^ - constant.character.entity -
another
disable test -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.disable-markdown -| ^^^^^^ meta.tag.inline.any.html -disabled markdown -| <- meta.disable-markdown +## https://spec.commonmark.org/0.30/#example-37 -non-disabled markdown -| <- - meta.disable-markdown +*foo* +| <- meta.paragraph.markdown constant.character.entity.decimal.html +|^^^^^^^^^^^^^ meta.paragraph.markdown - markup.italic +|^^^^ constant.character.entity.decimal.html +| ^^^^^ constant.character.entity.decimal.html -*a* -| ^ markup.italic -

*a*

-| ^^^^^^^^^ meta.disable-markdown - markup.italic -*a* -| ^^ meta.disable-markdown +*foo* +| <- meta.paragraph.markdown markup.italic.markdown +|^^^^ meta.paragraph.markdown markup.italic.markdown -non-disabled markdown -| <- - meta.disable-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 -# Block Quote Tests ########################################################### +* foo +| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown +|^^^^^ markup.list.unnumbered.markdown ->= -| <- punctuation.definition.blockquote.markdown +## https://spec.commonmark.org/0.30/#example-39 ->== -| <- punctuation.definition.blockquote.markdown +foo bar +| <- meta.paragraph.markdown +|^^^^^^^^^^^^^^^^ meta.paragraph.markdown +| ^^^^^^^^^^ constant.character.entity.decimal.html - >= -| ^ punctuation.definition.blockquote.markdown - >= -| ^^ - punctuation.definition.blockquote.markdown +## https://spec.commonmark.org/0.30/#example-40 - >= -| ^^ - punctuation.definition.blockquote.markdown + foo +| <- meta.paragraph.markdown constant.character.entity.decimal.html +|^^^ meta.paragraph.markdown constant.character.entity.decimal.html +| ^^^^ meta.paragraph.markdown - constant -> Block quote -| <- markup.quote punctuation.definition.blockquote -| ^^^^^^^^^^^ markup.quote +## https://spec.commonmark.org/0.30/#example-41 -> Block quote followed by an empty block quote line -> -| <- markup.quote punctuation.definition.blockquote +[a](url "tit") +| ^^^^^^^^^^^^^^^^^ meta.paragraph.markdown - meta.link +| ^^^^^^ constant.character.entity.named.html +| ^^^ - constant +| ^^^^^^ constant.character.entity.named.html -> 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 +# TEST: THEMATIC BREAKS ####################################################### -> > 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-43 -> Here is a block quote -This quote continues on. Line breaking is OK in markdown -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote -> Here it is again -| <- punctuation.definition.blockquote +*** +|^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown -paragraph -| <- meta.paragraph +--- +|^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown -> > this is a nested quote but no code in a block quote -| <- punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.quote.markdown markup.quote.markdown +___ +|^^^ meta.separator.thematic-break.markdown +|^^ punctuation.definition.thematic-break.markdown -> > 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-44 -> 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.separator +|^^^ - 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-45 -> 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 +=== +| <- - meta.separator +|^^^ - meta.separator -> 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 +## https://spec.commonmark.org/0.30/#example-46 -> 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 +** +| <- - meta.separator +|^ - meta.separator -> 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 +-- +| <- - meta.separator +|^ - meta.separator -> > 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 +__ +| <- - meta.separator +|^ - meta.separator -> 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 +## https://spec.commonmark.org/0.30/#example-47 -> 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 + *** +|<- meta.separator.thematic-break.markdown - punctuation +|^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -> 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 + *** +|<- meta.separator.thematic-break.markdown - punctuation +|^ meta.separator.thematic-break.markdown - punctuation +| ^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -> 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 + *** +|<- meta.separator.thematic-break.markdown - punctuation +|^^ meta.separator.thematic-break.markdown - punctuation +| ^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.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 +## https://spec.commonmark.org/0.30/#example-48 -> Block quote followed by list -* list item -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote + *** +|<- markup.raw.block.markdown +|^^^^^^^ markup.raw.block.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-49 -> Block quote followed by list -- list item -| <- markup.list.unnumbered.bullet.markdown punctuation.definition.list_item.markdown -|^^^^^^^^^^^ markup.list.unnumbered.markdown - meta.quote +Foo + *** +| <- meta.paragraph.markdown +|^^^^^^^ meta.paragraph.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 +## https://spec.commonmark.org/0.30/#example-50 -> Block quote followed by thematic break -*** -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote +************************************** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -> Block quote followed by thematic break -- - - -| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - meta.quote +-------------------------------------- +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown -Code block below: +_____________________________________ +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - this is code! -| ^^^^^^^^^^^^^^^^ markup.raw.block +## https://spec.commonmark.org/0.30/#example-51 - more code - spanning multiple lines -| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block + * * * +| <- 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 -paragraph -| <- meta.paragraph + - - - +| <- 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 -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ - punctuation -* * * * * -| ^^^^^^^^ meta.separator + _ _ _ +| <- 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 -| ^ punctuation.definition.thematic-break -| ^ punctuation.definition.thematic-break -| ^ - punctuation +## https://spec.commonmark.org/0.30/#example-52 -- - - - -| <- meta.separator.thematic-break punctuation.definition.thematic-break -|^^ - punctuation -| ^ punctuation -| ^ 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 + + __ _ __ _ __ _ __ +| <- 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 -###[ COMMONMARK AUTOLINKS ]################################################### +## https://spec.commonmark.org/0.30/#example-54 - -| <- 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.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.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.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.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.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.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.30/#example-55 - -| <- 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 +_ _ _ _ a +| <- meta.paragraph.markdown - meta.separator +|^^^^^^^^^ meta.paragraph.markdown - meta.separator - -| <- 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 +a------ +| <- meta.paragraph.markdown - meta.separator +|^^^^^^^ meta.paragraph.markdown - meta.separator - -| <- 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 +---a--- +| <- meta.paragraph.markdown - meta.separator +|^^^^^^^ meta.paragraph.markdown - meta.separator - -| <- 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.30/#example-56 - -| <- 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.paragraph.markdown - meta.separator +|^^^ meta.paragraph.markdown - meta.separator - -| <- 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.30/#example-57 - -| <- 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 +*** +| <- 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 - -| <- 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.30/#example-58 -###[ GFM AUTOLINKS ]########################################################## +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 -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 +## https://spec.commonmark.org/0.30/#example-59 -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 +Foo +--- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +bar +| <- meta.paragraph.markdown -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 +## https://spec.commonmark.org/0.30/#example-60 -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 +* 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 -Visit www.commonmark.org/help for more information. -| ^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^^^^^^^^^^^^^^^^^^^^^^^ - markup.underline.link +## https://spec.commonmark.org/0.30/#example-61 -Visit www.commonmark.org. -| ^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inet.markdown markup.underline.link -| ^^ - markup.underline.link +- Foo +- * * * +| ^^^^^^ markup.list.unnumbered.markdown meta.separator.thematic-break.markdown -Visit www.commonmark.org/a.b. -| ^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph meta.link.inet.markdown markup.underline.link -| ^ - markup.underline.link -| ^ punctuation.separator.path.markdown -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 +# TEST: ATX HEADINGS ########################################################## -www.google.com/search?q=Markup+(business) -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^ punctuation.separator.path.markdown +## https://spec.commonmark.org/0.30/#example-62 -www.commonmark.org/he -|^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^ punctuation.separator.path.markdown -| ^ - markup.underline.link +# foo +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.1.markdown - punctuation -http://commonmark.org -|^^^^^^^^^^^^^^^^^^^^ meta.link.inet.markdown markup.underline.link -| ^^^ punctuation.separator.path.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 -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 +### foo +| <- markup.heading.3.markdown punctuation.definition.heading.begin.markdown +|^^ markup.heading.3.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.3.markdown - punctuation -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 +| <- markup.heading.4.markdown punctuation.definition.heading.begin.markdown +|^^^ markup.heading.4.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.4.markdown - punctuation -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 +##### foo +| <- markup.heading.5.markdown punctuation.definition.heading.begin.markdown +|^^^^ markup.heading.5.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.5.markdown - punctuation -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 +| <- markup.heading.6.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.6.markdown punctuation.definition.heading.begin.markdown +| ^^^^^ markup.heading.6.markdown - punctuation -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.30/#example-63 -(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 +####### foo +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^^^^^ meta.paragraph.markdown - markup.heading -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.30/#example-64 -(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 +#5 bolt +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^ meta.paragraph.markdown - markup.heading -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 +#hashtag +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^^ meta.paragraph.markdown - markup.heading -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.30/#example-65 - 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 +| <- meta.paragraph.markdown constant.character.escape.markdown - markup +|^ meta.paragraph.markdown constant.character.escape.markdown - markup +| ^^^^^^ meta.paragraph.markdown - constant - markup - 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 +## https://spec.commonmark.org/0.30/#example-66 - a.b-c_d@a.b- -| <- - meta.link - markup.underline -|^^^^^^^^^^^^^ - meta.link - markup.underline.link +# 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 - a.b-c_d@a.b_ -| <- - meta.link - markup.underline -|^^^^^^^^^^^^^ - meta.link - markup.underline.link +## https://spec.commonmark.org/0.30/#example-67 -###[ LIGATURES ]############################################################## +# 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 -this is a raw ampersand & does not require HTML escaping -| ^ - entity - illegal +## https://spec.commonmark.org/0.30/#example-68 -this is a raw bracket < > does not require HTML escaping -| ^^^ - meta.tag - punctuation + ### 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 -these are raw ligatures << <<< <<<< <<<<< >>>>> >>>> >>> >> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag +## https://spec.commonmark.org/0.30/#example-69 -these are raw ligatures <- <-- <--- <---- <-< <--< <---< <----< -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag + # foo +| <- markup.raw.block.markdown +|^^^^^^^^^ markup.raw.block.markdown -these are raw ligatures -> --> ---> ----> >-> >--> >---> >----> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag +## https://spec.commonmark.org/0.30/#example-70 -these are raw ligatures >- >-- >--- >---- ----< ---< --< -< -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag +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 -these are raw ligatures >< >-< >--< >---< <---> <--> <-> <> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag +## https://spec.commonmark.org/0.30/#example-74 -these are raw ligatures <= <== <=== <==== <=< <==< <===< <====< -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag +### 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 -these are raw ligatures => ==> ===> ====> >=> >==> >===> >====> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag +## https://spec.commonmark.org/0.30/#example-75 -these are raw ligatures >= >== >=== >==== ====< ===< ==< =< -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag +# foo# +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^^ markup.heading.1.markdown +|^ - entity - punctuation +| ^^^^ entity.name.section.markdown +| ^ - entity -these are raw ligatures >< >=< >==< >===< <===> <==> <=> <> -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag +# 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 -these are raw ligatures - -- --- ---- ----- ===== ==== === == = -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.other.valid-bracket - meta.tag +## https://spec.commonmark.org/0.30/#example-76 -[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 - -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 +### 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 -* this is a list +## 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 - > This is a blockquote. -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote +# 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 - - this is a list - > This is a blockquote. -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote +## https://spec.commonmark.org/0.30/#example-77 - This is a paragraph still part of the - list item -| ^^^^^^^^^ markup.list.unnumbered meta.paragraph.list - meta.paragraph.list meta.paragraph.list +**** +## foo +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown +|^^^^^^ markup.heading.2.markdown -* Lorem ipsum +**** +## foo +**** +| <- meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown +|^^^ meta.separator.thematic-break.markdown punctuation.definition.thematic-break.markdown - 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 +## https://spec.commonmark.org/0.30/#example-78 -> * [ ] 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 +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^^^ markup.heading.1.markdown -* list item - -

*no-markdown*

-| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown -| ^^^^ meta.tag - - list item +Foo bar +# baz +Bar foo +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^ meta.paragraph.markdown - markup.heading -

*no-markdown*

-| ^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered.markdown meta.disable-markdown -| ^^^^ meta.tag +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 -- `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) numberd item -| <- markup.list.numbered.bullet.markdown -|^ markup.list.numbered.bullet.markdown punctuation.definition.list_item.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown +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 - 2) numberd item -| <- markup.list.numbered.markdown -|^^ markup.list.numbered.bullet.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown +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 - 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-79 - 4) numberd item -| <- markup.list.numbered.markdown -|^^ markup.list.numbered.markdown -| ^^ markup.list.numbered.bullet.markdown -| ^^^^^^^^^^^^^^ markup.list.numbered.markdown +# +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown - -| ^^^^^^^^^^^^^^^^^^^^^ comment.block.html +# # +| <- markup.heading.1.markdown punctuation.definition.heading.begin.markdown +|^^^ markup.heading.1.markdown - entity.name.section +| ^ punctuation.definition.heading.end.markdown -*italic text HTML element end of italic text* -| <- punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +## +| <- markup.heading.2.markdown punctuation.definition.heading.begin.markdown - entity.name.section +|^ markup.heading.2.markdown punctuation.definition.heading.begin.markdown - entity.name.section -_italic text HTML element end of italic text_ -| <- punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +## ## +| <- 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 -**bold text HTML element end of bold text** -| <- punctuation.definition.bold -| ^^ punctuation.definition.bold -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +### ### +| <- 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 -__bold text HTML element end of bold text__ -| <- punctuation.definition.bold -| ^^ punctuation.definition.bold -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +# #### # +| <- 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 -*italic text HTML element end of italic text* -| <- punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^^^^^ meta.tag.inline.any.html -| ^^^^^^^ meta.tag.inline.any.html +## #### ## +| <- 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 -_italic text HTML element end of italic text_ -| <- punctuation.definition.italic -| ^ punctuation.definition.italic -| ^^^^^^ 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 +# TEST: SETEXT HEADINGS ####################################################### -This is a [reference] () -| ^^^^^^^^^^^ meta.link.reference -| ^^^^ - meta.link +SETEXT Heading Level 1 +| <- markup.heading.1.markdown entity.name.section.markdown +================= +| <- markup.heading.1.markdown punctuation.definition.heading.setext.markdown +|^^^^^^^^^^^^^^^^ markup.heading.1.markdown punctuation.definition.heading.setext.markdown +| ^ markup.heading.1.markdown meta.whitespace.newline.markdown -This is a [reference] (followed by parens) -| ^^^^^^^^^^^ meta.link.reference -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link +SETEXT Heading Level 2 +| <- markup.heading.2.markdown entity.name.section.markdown +------------------------------ +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +| ^ markup.heading.2.markdown meta.whitespace.newline.markdown - punctuation -This is a [reference] [] -| ^^^^^^^^^^^ meta.link.reference -| ^ - meta.link -| ^^ meta.link.reference +underlined heading followed by a separator +------------------- +------ +| <- meta.separator.thematic-break.markdown - markup.heading -This is a ![reference] () -| ^^^^^^^^^^^^^^^ - meta.image -| ^^^^^^^^^^^ meta.link.reference -| ^^^^ - meta.link +underlined heading followed by another one that should be treated as a normal paragraph +================== +===== +| <- meta.paragraph.markdown - markup.heading -This is a ![reference] (followed by parens) -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.image -| ^^^^^^^^^^^ meta.link.reference -| ^^^^^^^^^^^^^^^^^^^^^ - meta.link +https://spec.commonmark.org/0.30/#example-80 -This is a ![reference] [] -| ^^^^^^^^^^^^^^^ - meta.image -| ^^^^^^^^^^^ meta.link.reference -| ^ - meta.link -| ^^ meta.link.reference +Foo *bar* +| <- markup.heading.1.markdown entity.name.section.markdown +|^^^^^^^^^ markup.heading.1.markdown entity.name.section.markdown +| ^^^^^ markup.italic.markdown +========= +| <- markup.heading.1.markdown punctuation.definition.heading.setext.markdown +|^^^^^^^^ markup.heading.1.markdown punctuation.definition.heading.setext.markdown +| ^ markup.heading.1.markdown meta.whitespace.newline.markdown -http://spec.commonmark.org/0.28/#example-322 -*foo`*` -|^^^^^^^ markup.italic -| ^^^ markup.raw.inline +Foo *bar* +| <- markup.heading.2.markdown entity.name.section.markdown +|^^^^^^^^^ markup.heading.2.markdown entity.name.section.markdown +| ^^^^^ markup.italic.markdown +--------- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^^^^^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +| ^ markup.heading.2.markdown meta.whitespace.newline.markdown -| <- invalid.illegal.non-terminated.bold-italic +Foo *bar +| <- markup.heading.1.markdown entity.name.section.markdown +|^^^^^^^^^ markup.heading.1.markdown entity.name.section.markdown +| ^^^^^ markup.italic.markdown +========= +| <- markup.heading.1.markdown punctuation.definition.heading.setext.markdown - markup.italic +|^^^^^^^^ markup.heading.1.markdown punctuation.definition.heading.setext.markdown - markup.italic +| ^ markup.heading.1.markdown meta.whitespace.newline.markdown - markup.italic -http://spec.commonmark.org/0.28/#example-323 -[not a `link](/foo`) -|^^^^^^^^^^^^^^^^^^^ - meta.link -| ^^^^^^^^^^^^ markup.raw.inline +Foo *bar +| <- markup.heading.2.markdown entity.name.section.markdown +|^^^^^^^^^ markup.heading.2.markdown entity.name.section.markdown +| ^^^^^ markup.italic.markdown +--------- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown - markup.italic +|^^^^^^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown - markup.italic +| ^ markup.heading.2.markdown meta.whitespace.newline.markdown - markup.italic -http://spec.commonmark.org/0.28/#example-324 -`` -|^^^^^^^^^^ markup.raw.inline -| ^^ - markup.raw +https://spec.commonmark.org/0.30/#example-81 -| <- invalid.illegal.non-terminated.raw +Foo *bar +baz* +| <- markup.heading.1.markdown entity.name.section.markdown markup.italic.markdown +|^^^ markup.heading.1.markdown entity.name.section.markdown markup.italic.markdown +| ^ markup.heading.1.markdown entity.name.section.markdown - markup.italic +==== +| <- markup.heading.1.markdown punctuation.definition.heading.setext.markdown +|^^^ markup.heading.1.markdown punctuation.definition.heading.setext.markdown +| ^ markup.heading.1.markdown meta.whitespace.newline.markdown -http://spec.commonmark.org/0.28/#example-325 -` -| ^^^^^^^^^ meta.tag.inline.a -| ^ punctuation.definition.raw.begin +https://spec.commonmark.org/0.30/#example-82 -| <- invalid.illegal.non-terminated.raw + Foo *bar +baz* +| <- markup.heading.1.markdown entity.name.section.markdown markup.italic.markdown +|^^^ markup.heading.1.markdown entity.name.section.markdown markup.italic.markdown +| ^^ markup.heading.1.markdown entity.name.section.markdown - markup.italic +==== +| <- markup.heading.1.markdown punctuation.definition.heading.setext.markdown +|^^^ markup.heading.1.markdown punctuation.definition.heading.setext.markdown +| ^ markup.heading.1.markdown meta.whitespace.newline.markdown -http://spec.commonmark.org/0.28/#example-326 -`` -|^^^^^^^^^^^^^^^^^ markup.raw.inline -| ^ punctuation.definition.raw.begin +https://spec.commonmark.org/0.30/#example-83 -| <- invalid.illegal.non-terminated.raw +Foo += +| <- markup.heading.1.markdown punctuation.definition.heading.setext.markdown +|^ markup.heading.1.markdown meta.whitespace.newline.markdown -http://spec.commonmark.org/0.28/#example-327 -` -|^^^^^^^^^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.raw.begin +Foo +- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^ markup.heading.2.markdown meta.whitespace.newline.markdown -| <- invalid.illegal.non-terminated.raw +https://spec.commonmark.org/0.30/#example-84 -http://spec.commonmark.org/0.27/#example-328 -*foo bar* -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end + Foo +--- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +| ^ markup.heading.2.markdown meta.whitespace.newline.markdown -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 + Foo +----- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +| ^ markup.heading.2.markdown meta.whitespace.newline.markdown -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 + Foo + === +| <- markup.heading.1.markdown - punctuation +|^ markup.heading.1.markdown - punctuation +| ^^^ markup.heading.1.markdown punctuation.definition.heading.setext.markdown +| ^ markup.heading.1.markdown meta.whitespace.newline.markdown -http://spec.commonmark.org/0.27/#example-334 -_foo bar_ -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end +https://spec.commonmark.org/0.30/#example-85 -http://spec.commonmark.org/0.27/#example-335 -This is not emphasis, because the opening `_` is followed by whitespace: -_ foo bar_ -| <- - punctuation -| ^^^^^^^^^ - punctuation + Foo + --- +|^^^^^^^ markup.raw.block.markdown -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 + Foo +--- +| <- meta.separator.thematic-break.markdown - markup.heading +|^^^ meta.separator.thematic-break.markdown - markup.heading -http://spec.commonmark.org/0.27/#example-337 -Emphasis with `_` is not allowed inside words: -foo_bar_ -| ^^^^^ - punctuation +https://spec.commonmark.org/0.30/#example-86 -http://spec.commonmark.org/0.27/#example-338 -5_6_78 -|^^^^^ - punctuation +Foo + ---- +|^^^^^^^^^^^^^ markup.heading.2.markdown +|^^ - punctuation +| ^^^^ punctuation.definition.heading.setext.markdown +| ^^^^^^^ - punctuation +| ^ meta.whitespace.newline.markdown -http://spec.commonmark.org/0.27/#example-339 -пристаням_стремятся_ -| ^^^^^^^^^^^ - punctuation +https://spec.commonmark.org/0.30/#example-87 -http://spec.commonmark.org/0.27/#example-341 -foo-_(bar)_ -| ^ punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end +Foo + --- +| <- meta.paragraph.markdown - markup.heading +|^^^^^^^ meta.paragraph.markdown - markup.heading -*foo bar * -| <- punctuation.definition.italic.begin -| ^ - punctuation -* -| <- - punctuation -abc* -| ^ punctuation.definition.italic.end +https://spec.commonmark.org/0.30/#example-88 -http://spec.commonmark.org/0.27/#example-347 -*foo*bar -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end +Foo += = +| <- meta.paragraph.markdown - markup.heading +|^^^ meta.paragraph.markdown - markup.heading -http://spec.commonmark.org/0.27/#example-348 -_foo bar _ -| <- punctuation.definition.italic.begin -| ^ - punctuation -_ -| <- - punctuation -abc_ -| ^ punctuation.definition.italic.end +Foo +--- - +| <- meta.separator.thematic-break.markdown - markup.heading +|^^^^^ meta.separator.thematic-break.markdown - markup.heading -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 +https://spec.commonmark.org/0.30/#example-89 -http://spec.commonmark.org/0.27/#example-353 -_foo_bar_baz_ -| <- punctuation.definition.italic.begin -| ^^^^^ - punctuation -| ^ punctuation.definition.italic.end +Foo +| ^^ markup.heading.2.markdown entity.name.section.markdown - meta.hard-line-break +----- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown -http://spec.commonmark.org/0.27/#example-354 -_(bar)_. -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end +https://spec.commonmark.org/0.30/#example-90 -http://spec.commonmark.org/0.27/#example-355 - **foo bar** -|^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end +Foo\ +| ^ markup.heading.2.markdown entity.name.section.markdown - meta.hard-line-break +---- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown -http://spec.commonmark.org/0.27/#example-356 -** foo bar** -| <- - punctuation -| ^^ - punctuation +https://spec.commonmark.org/0.30/#example-91 -http://spec.commonmark.org/0.27/#example-358 -foo**bar** -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end +`Foo +---- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown -http://spec.commonmark.org/0.27/#example-359 - __foo bar__ -|^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end +`Foo` +---- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown -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 +https://spec.commonmark.org/0.30/#example-92 -http://spec.commonmark.org/0.27/#example-361 -__ -| <- - punctuation +> Foo +--- +| <- meta.separator.thematic-break.markdown - markup.heading +|^^^ meta.separator.thematic-break.markdown - markup.heading -http://spec.commonmark.org/0.27/#example-362 -a__"foo"__ -|^^^^^^^^^ - punctuation +https://spec.commonmark.org/0.30/#example-93 -http://spec.commonmark.org/0.27/#example-363 -Intraword strong emphasis is forbidden with `__`: -foo__bar__ -| ^^^^^^^ - punctuation +> foo +bar +=== +| <- markup.quote.markdown - markup.heading +|^^^ markup.quote.markdown - markup.heading -http://spec.commonmark.org/0.27/#example-364 -5__6__78 -|^^^^^^^ - punctuation +https://spec.commonmark.org/0.30/#example-94 +- Foo +--- +| <- meta.separator.thematic-break.markdown - markup.heading +|^^^ meta.separator.thematic-break.markdown - markup.heading -http://spec.commonmark.org/0.27/#example-367 -foo-__(bar)__ -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end +https://spec.commonmark.org/0.30/#example-95 -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 +Foo +Bar +--- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown -http://spec.commonmark.org/0.27/#example-374 - __foo bar __ -|^^ punctuation.definition.bold.begin -| ^^ - punctuation -abc__ -| ^^ punctuation.definition.bold.end +https://spec.commonmark.org/0.30/#example-96 -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 +--- +Foo +--- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown -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 +--- +Foo +--- +Bar +--- +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown +Baz -http://spec.commonmark.org/0.27/#example-379 -__foo__bar__baz__ -| <- punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end -| ^^^^^^^^^^ - punctuation +--- +Foo +--- +Bar +--- +Baz +| <- meta.paragraph.markdown +|^^^ meta.paragraph.markdown -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 +https://spec.commonmark.org/0.30/#example-97 -http://spec.commonmark.org/0.27/#example-381 -*foo [bar](/url)* -| <- punctuation.definition.italic.begin -| ^ punctuation.definition.italic.end -| ^^^^^^^^^^^ meta.link.inline +==== +| <- meta.paragraph.markdown +|^^^^ meta.paragraph.markdown -http://spec.commonmark.org/0.27/#example-382 -*foo -| <- punctuation.definition.italic.begin -bar* -| ^ punctuation.definition.italic.end +https://spec.commonmark.org/0.30/#example-98 -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 +--- +--- +| <- meta.separator.thematic-break.markdown - markup.heading +|^^^ meta.separator.thematic-break.markdown - markup.heading -http://spec.commonmark.org/0.27/#example-394 -** is not an empty emphasis -| <- - punctuation -|^ - punctuation +https://spec.commonmark.org/0.30/#example-102 -http://spec.commonmark.org/0.27/#example-395 -**** is not an empty strong emphasis -| <- - punctuation -|^^^ - punctuation +\> foo +------ +| <- markup.heading.2.markdown punctuation.definition.heading.setext.markdown +|^^^^^ markup.heading.2.markdown punctuation.definition.heading.setext.markdown -http://spec.commonmark.org/0.27/#example-396 -**foo [bar](/url)** -| <- punctuation.definition.bold.begin -| ^^^^^^^^^^^ meta.link.inline -| ^^ punctuation.definition.bold.end +``` +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 -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 +# TEST: INDENTED CODE BLOCKS ################################################## -http://spec.commonmark.org/0.27/#example-408 -__ is not an empty emphasis -| <- - punctuation -|^ - punctuation +Code block below: -http://spec.commonmark.org/0.27/#example-409 -____ is not an empty strong emphasis -| <- - punctuation -|^^^ - punctuation + this is code! +| ^^^^^^^^^^^^^^^^ markup.raw.block + more code + spanning multiple lines +| ^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.raw.block -http://spec.commonmark.org/0.27/#example-410 -foo *** -| ^^^ - punctuation +paragraph +| <- meta.paragraph -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 +# TEST: FENCED CODE BLOCKS #################################################### -http://spec.commonmark.org/0.27/#example-414 -foo **\*** -| ^^ punctuation.definition.bold.begin -| ^^ constant.character.escape -| ^^ punctuation.definition.bold.end +## https://spec.commonmark.org/0.30/#example-119 -http://spec.commonmark.org/0.27/#example-415 -foo **_** -| ^^ punctuation.definition.bold.begin -| ^ - punctuation -| ^^ punctuation.definition.bold.end +``` +| <- 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 -http://spec.commonmark.org/0.27/#example-422 -foo ___ -| ^^^^ - punctuation +## https://spec.commonmark.org/0.30/#example-120 -http://spec.commonmark.org/0.27/#example-423 -foo _\__ -| ^ punctuation.definition.italic.begin -| ^^ constant.character.escape -| ^ punctuation.definition.italic.end +~~~ +| <- 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 -http://spec.commonmark.org/0.27/#example-424 -foo _*_ -| ^ punctuation.definition.italic.begin -| ^ - punctuation -| ^ punctuation.definition.italic.end +## https://spec.commonmark.org/0.30/#example-121 -http://spec.commonmark.org/0.27/#example-426 -foo __\___ -| ^^ punctuation.definition.bold.begin -| ^^ constant.character.escape -| ^^ punctuation.definition.bold.end +`` +foo +`` +| <- - meta.code-fence - punctuation.definition.raw.code-fence +|^ - meta.code-fence - punctuation.definition.raw.code-fence -http://spec.commonmark.org/0.27/#example-427 -foo __*__ -| ^^ punctuation.definition.bold.begin -| ^ - punctuation -| ^^ punctuation.definition.bold.end +## https://spec.commonmark.org/0.30/#example-122 -This text is _bold_, but this__text__is neither bold_nor_italic -| ^ punctuation.definition.italic -| ^^^^ markup.italic -| ^ punctuation.definition.italic -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - markup.bold - markup.italic +``` +| <- 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 -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 +## https://spec.commonmark.org/0.30/#example-123 -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 +~~~ +| <- 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 -_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 +~~~~ +| <- punctuation.definition.raw.code-fence.begin + ~~~~ +| ^^^ punctuation.definition.raw.code-fence.end -__test text__ *formatted* -| <- punctuation -| ^^ punctuation -| ^ punctuation -| ^ punctuation +## https://spec.commonmark.org/0.30/#example-124 -This is ***bold italic*** -| ^^^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.end -| ^^ punctuation.definition.bold.end +```` +| <- 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 -This is ***bold italic* and just bold** -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.end -| ^^^^^^^^^^^^^^^^ - markup.italic -| ^^ punctuation.definition.bold.end +## https://spec.commonmark.org/0.30/#example-125 -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 +~~~~ +| <- 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 -This is **_bold italic_** -| ^^^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.end -| ^^ punctuation.definition.bold.end +## https://spec.commonmark.org/0.30/#example-128 -This is __*bold italic*__ -| ^^^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.end -| ^^ punctuation.definition.bold.end +> ``` +> aaa +| <- markup.quote.markdown punctuation.definition.blockquote.markdown +|^ markup.quote.markdown - markup.raw +| ^^^^ markup.quote.markdown markup.raw.code-fence.markdown-gfm -This is ___bold italic___ -| ^^^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.end -| ^^ punctuation.definition.bold.end +bbb +| <- meta.paragraph.markdown - markup.raw -This is ___bold italic_ and just bold__ -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.end -| ^^^^^^^^^^^^^^^^ - markup.italic -| ^^ punctuation.definition.bold.end +## https://spec.commonmark.org/0.30/#example-129 -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 +``` +| <- 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 -This is _**italic bold**_ -| ^^^^^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end -| ^ punctuation.definition.italic.end + +``` +| <- 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 -This is *__italic bold__* -| ^^^^^^^^^^^^^^^^^ markup.italic -| ^ punctuation.definition.italic.begin -| ^^^^^^^^^^^^^^^ markup.bold -| ^^ punctuation.definition.bold.begin -| ^^ punctuation.definition.bold.end -| ^ punctuation.definition.italic.end +## https://spec.commonmark.org/0.30/#example-130 -**test!_test** Issue 1163 -|^^^^^^^^^^^^^ markup.bold -| ^ - punctuation.definition.italic -| ^^ punctuation.definition.bold.end +``` +``` +| <- 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 -__test!*test__ Issue 1163 -|^^^^^^^^^^^^^ markup.bold -| ^ - punctuation.definition.italic -| ^^ punctuation.definition.bold.end +## https://spec.commonmark.org/0.30/#example-131 -# Strikethrough Tests + ``` + 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 -__~~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 +## https://spec.commonmark.org/0.30/#example-132 -**~~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 + ``` +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 -_~~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 +## https://spec.commonmark.org/0.30/#example-133 -*~~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 + ``` + 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 -___~~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 +## https://spec.commonmark.org/0.30/#example-134 -***~~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 + ``` + aaa + ``` +| <- markup.raw.block.markdown +|^^^^^^^ markup.raw.block.markdown - punctuation -~Hi~ Hello, world! -| <- punctuation.definition.strikethrough.begin -|^^^ meta.paragraph markup.strikethrough -| ^ punctuation.definition.strikethrough.end -| ^^^^^^^^^^^^^^^ meta.paragraph - markup +## https://spec.commonmark.org/0.30/#example-135 -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.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 -This ~~has a -| ^^^^^^^^ meta.paragraph markup.strikethrough +## https://spec.commonmark.org/0.30/#example-136 -| <- meta.paragraph markup.strikethrough invalid.illegal.non-terminated.bold-italic -new paragraph~~. -| ^^ meta.paragraph markup.strikethrough punctuation.definition.strikethrough.begin + ``` +| <- 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 -| <- invalid.illegal.non-terminated.bold-italic +## 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 -# Fenced Code Block Tests +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. ``` @@ -2341,635 +1667,508 @@ 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 +## https://spec.commonmark.org/0.30/#example-141 -```ts -| ^^ constant.other.language-name -declare type foo = 'bar' -``` +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 -```R%&?! weired language name -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -| ^^^^^ constant.other.language-name.markdown -| ^^^^^^^^^^^^^^^^^^^^^ - constant -``` +## https://spec.commonmark.org/0.30/#example-142 -```{key: value} -|^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -| ^^^^^^^^^^^^ - constant +```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 + return 3 +end +| <- 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 -``` {key: value} -|^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm -| ^^^^^^^^^^^^ - constant -``` +## https://spec.commonmark.org/0.30/#example-143 -```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 +~~~~ 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 + return 3 +end +| <- 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 -| <- invalid.illegal.non-terminated.raw -text -| <- - markup.raw +## https://spec.commonmark.org/0.30/#example-144 -http://spec.commonmark.org/0.28/#example-315 -`` foo ` bar `` -|^ punctuation.definition.raw.begin -|^^^^^^^^^^^^^^^ markup.raw.inline -| ^ - punctuation -| ^^ punctuation.definition.raw.end +````; +| <- 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 -http://spec.commonmark.org/0.28/#example-316 -` `` ` -|<- punctuation.definition.raw.begin -|^^^^^ markup.raw.inline -| ^^ - punctuation -| ^ punctuation.definition.raw.end +## https://spec.commonmark.org/0.30/#example-145 -http://spec.commonmark.org/0.28/#example-318 -`foo bar - baz` -|^^^^^ markup.raw.inline -| ^ punctuation.definition.raw.end +``` 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 -~~~~ -| <- punctuation.definition.raw.code-fence.begin - ~~~~ -| ^^^ punctuation.definition.raw.code-fence.end +## https://spec.commonmark.org/0.30/#example-146 -~~~~~test~ -| ^^^^^^^^^ meta.paragraph - constant - markup.raw +~~~ 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 -| ^^^^ punctuation.definition.raw.code-fence.begin -| ^^^^ constant.other.language-name -~~~~~~ -| ^^^^ punctuation.definition.raw.code-fence.end +~~~~~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 -```test -| ^^^^ constant.other.language-name - ``` -| ^^^ punctuation.definition.raw.code-fence.end +~~~~~ +|^^^^ meta.code-fence.definition.end.text.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -hello world ````test```` -| ^^^^^^^^^^^^ markup.raw.inline -| ^ - markup.raw +## https://spec.commonmark.org/0.30/#example-147 -`foo `` bar` -| ^^^^^^ markup.raw.inline - punctuation -| ^ punctuation.definition.raw.end +``` +| <- 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 -hard line break -| ^^ meta.hard-line-break punctuation.definition.hard-line-break -hard line break\ -| ^ meta.hard-line-break constant.character.escape -hard line break -| ^^^^^ meta.hard-line-break punctuation.definition.hard-line-break -soft line break -| ^^ - meta.hard-line-break -soft line break -| ^^ - meta.hard-line-break +## https://fenced-code-block-embedded-syntaxes-tests -### foo -| ^^^ - meta.hard-line-break -### foo\ -| ^ - meta.hard-line-break +```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 -`inline code with trailing spaces -| ^^^ - meta.hard-line-break -not a hard line break` +```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 -*test +```cmd -| <- invalid.illegal.non-terminated.bold-italic -abc* -| ^ - punctuation +| <- 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 -_test +```css -| <- invalid.illegal.non-terminated.bold-italic -abc_ -| ^ - punctuation +| <- 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 -**test +```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 -| <- invalid.illegal.non-terminated.bold-italic -abc** -| ^^ - punctuation +```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 -__test +```haskell -| <- invalid.illegal.non-terminated.bold-italic -abc__ -| ^^ - punctuation +| <- 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 -__test\ -| ^ meta.hard-line-break constant.character.escape -testing__ +```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 -- 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 +```html+php +
+|^^^ entity.name.tag.block.any.html +→][details] -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.description -| ^^^^^^^^^^^^^^^^^^ source.css -| ^^^^^^^ constant.character.entity.decimal.html -| ^^^^^^^ markup.underline.link +| <- markup.raw.code-fence.lua.markdown-gfm source.lua +``` +| <- meta.code-fence.definition.end.lua.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.lua.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -[![Cool ★ Image - Click to Enlarge][img-example]][img-example] -|^ punctuation.definition.image.begin -| ^^^^^^^^^^^ markup.underline.link -| ^ punctuation.definition.link.end -| ^^^^^^^^^^^ markup.underline.link +```matlab -[![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 +| <- markup.raw.code-fence.matlab.markdown-gfm source.matlab +``` +| <- meta.code-fence.definition.end.matlab.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.matlab.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -[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 +```ocaml -[//]: # (This is a comment without a line-break.) -| ^ meta.link.reference.def.markdown markup.underline.link -| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.other -| ^ - meta.link +| <- markup.raw.code-fence.ocaml.markdown-gfm source.ocaml +``` +| <- meta.code-fence.definition.end.ocaml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.ocaml.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -[//]: # (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 +```php +var_dump(expression); +| <- markup.raw.code-fence.php.markdown-gfm source.php meta.function-call.php +``` +| <- meta.code-fence.definition.end.php.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.php.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -[//]: # (testing)blah -|^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.markdown -| ^ punctuation.definition.string.begin -| ^ punctuation.definition.string.end -| ^^^^ invalid.illegal.expected-eol -| ^ - meta.link - invalid +```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.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.python.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -[//]: # (testing -blah -| <- meta.link.reference.def.markdown string.quoted.other +```regex +(?x) +\s+ +| <- 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 -| <- invalid.illegal.non-terminated.link-title -text -| <- meta.paragraph - meta.link.reference.def.markdown +```scala -[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 +| <- markup.raw.code-fence.scala.markdown-gfm source.scala +``` +| <- meta.code-fence.definition.end.scala.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.scala.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -[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 +```sh -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 +| <- 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 - [^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 +```shell -[^1]: - And that's the footnote. +| <- 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 - That's the *second* paragraph. -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.link.reference.def.footnote.markdown-extra - markup.raw -| ^^^^^^^^ markup.italic +```shell-script -- 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 +| <- 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 - code here - | ^^^^^^^^ markup.raw.block +```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 - - e -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item +```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 - code here +```tsx - > block quote code here -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote -| ^^^^^^^^^^^^^^^^^^^^^^ markup.list.unnumbered markup.quote markup.raw.block +| <- 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 - > > test -| ^ markup.list.unnumbered markup.quote punctuation.definition.blockquote -| ^ markup.list.unnumbered markup.quote markup.quote punctuation.definition.blockquote - markup.raw.block +```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 - - f -| ^ markup.list.unnumbered.bullet punctuation.definition.list_item - 1. test -| ^^ markup.list.numbered.bullet -| ^ punctuation.definition.list_item +```R%&?! weired language name +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +| ^^^^^ constant.other.language-name.markdown +| ^^^^^^^^^^^^^^^^^^^^^ - constant +``` -abc -| <- meta.paragraph - markup.list +```{key: value} +|^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +| ^^^^^^^^^^^^ - constant +``` -| 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 +``` {key: value} +|^^^^^^^^^^^^^^^^ meta.code-fence.definition.begin.text.markdown-gfm +| ^^^^^^^^^^^^ - constant +``` -| 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 +# TEST: HTML BLOCKS ########################################################### -not a table | -| ^^^^^^^^^^^^^ - meta.table +## https://spec.commonmark.org/0.30/#example-148 - abc | def - --- | --- - --- | --- -| ^^^^ meta.table - meta.table.header +
+
+**Hello**,
+| ^^^^^^^^^ meta.disable-markdown - markup
 
- 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
+_world_.
+| ^^^^ markup.italic - meta.disable-markdown
+
+
- 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 +## https://spec.commonmark.org/0.30/#example-149 -| 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 + + + + +
+ hi +|^^^^^^^^^^^^^ meta.disable-markdown +
-| table | followed by -paragraph +okay. | <- 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 +|^^^^^ meta.paragraph.markdown -A line without bolded | -| ^ - punctuation.separator.table-cell - -A line with bolded **|** -| ^ - punctuation.separator.table-cell +## https://spec.commonmark.org/0.30/#example-150 -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 +
+*foo* +| <- meta.disable-markdown - markup.italic +|^^^^^ meta.disable-markdown - markup.italic - 2. test -| ^ punctuation.definition.list_item +## https://spec.commonmark.org/0.30/#example-152 -Normal paragraph -| <- meta.paragraph - markup +
+| ^^^^^^^^^^^^^^^^ meta.disable-markdown -1. List - 1. Nested list - 2. Second item +*Markdown* +| ^^^^^^^ meta.paragraph markup.italic - meta.disable-markdown - This line is still list item 1 -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.list.numbered - markup.raw.block +
+| ^^^ meta.disable-markdown meta.tag.block.any.html -Test -| <- meta.paragraph - markup.list +## https://spec.commonmark.org/0.30/#example-153 -http://spec.commonmark.org/0.28/#example-116 +
+|^^^^^^^^^^^^^ meta.disable-markdown meta.tag.block +
+|^^^^^ meta.disable-markdown meta.tag.block -
-
-**Hello**,
-| ^^^^^^^^^ meta.disable-markdown
+## https://spec.commonmark.org/0.30/#example-154
 
-_world_.
-| ^^^^ markup.italic - meta.disable-markdown
-
-
+
+|^^^^^^ meta.disable-markdown meta.tag.block +
+|^^^^^ meta.disable-markdown meta.tag.block -http://spec.commonmark.org/0.28/#example-120 +## https://spec.commonmark.org/0.30/#example-155 -
-| ^^^^^^^^^^^^^^^^ meta.disable-markdown +
+*foo* +| <- meta.disable-markdown - markup.italic -*Markdown* -| ^^^^^^^ meta.paragraph markup.italic - meta.disable-markdown +
+*foo* -
-| ^^^ meta.disable-markdown meta.tag.block.any.html +*bar* +| <- meta.paragraph.markdown markup.italic.markdown punctuation.definition.italic.begin.markdown -http://spec.commonmark.org/0.28/#example-127 +## https://spec.commonmark.org/0.30/#example-159
| ^^^^^ meta.disable-markdown - markup.italic -http://spec.commonmark.org/0.28/#example-129 +## https://spec.commonmark.org/0.30/#example-161
``` c int x = 33; ``` -| ^^ meta.disable-markdown +|^^^ meta.disable-markdown -http://spec.commonmark.org/0.28/#example-130 +## https://spec.commonmark.org/0.30/#example-162 *bar* -|^^^^^ meta.disable-markdown +| <- meta.disable-markdown - markup.italic - punctuation +|^^^^^ meta.disable-markdown - markup.italic -http://spec.commonmark.org/0.28/#example-131 +## https://spec.commonmark.org/0.30/#example-163 *bar* -|^^^^^ meta.disable-markdown +| <- meta.disable-markdown - markup.italic - punctuation +|^^^^^ meta.disable-markdown - markup.italic | ^^^^^^^ meta.disable-markdown meta.tag.other.html entity.name.tag.other.html -http://spec.commonmark.org/0.28/#example-135 +## https://spec.commonmark.org/0.30/#example-164 - -| ^^ meta.disable-markdown meta.tag.inline.any.html entity.name.tag.inline.any.html + +*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 -*foo* -| ^^ meta.paragraph markup.italic +## 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.inline.any.html entity.name.tag.inline.any.html +| <- 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.disable-markdown +| <- 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 -http://spec.commonmark.org/0.28/#example-136 +## https://spec.commonmark.org/0.30/#example-168 *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 +|^^^^ meta.tag.inline +| ^^^^^ markup.italic +| ^^^^^^ meta.tag.inline -http://spec.commonmark.org/0.28/#example-137 +## https://spec.commonmark.org/0.30/#example-169

 | ^^ meta.disable-markdown meta.tag.block.any.html entity.name.tag.block.any.html
@@ -2984,7 +2183,7 @@ main = print $ parseTags tags
 okay
 | <- - meta.disable-markdown
 
-http://spec.commonmark.org/0.28/#example-138
+## https://spec.commonmark.org/0.30/#example-170