on master help sign in
Use split_parser branch for markdown grammar (#3108)
ea04220Matthias Deiml
book/src/generated/lang-support.md+1
@@ -62,6 +62,7 @@
62| lua | ✓ | | ✓ | `lua-language-server` |
62| lua | ✓ | | ✓ | `lua-language-server` |
63| make | ✓ | | | |
63| make | ✓ | | | |
64| markdown | ✓ | | | |
64| markdown | ✓ | | | |
65+| markdown.inline | ✓ | | | |
65| meson | ✓ | | ✓ | |
66| meson | ✓ | | ✓ | |
66| mint | | | | `mint` |
67| mint | | | | `mint` |
67| nickel | ✓ | | ✓ | `nls` |
68| nickel | ✓ | | ✓ | `nls` |
languages.toml+13−1
@@ -884,7 +884,19 @@ indent = { tab-width = 2, unit = " " }
884
884
885[[grammar]]
885[[grammar]]
886name = "markdown"
886name = "markdown"
887−source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "ab15701d8f3f68aeb74e30573b7d669a6ef2a7ed" }
887+source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "142a5b4a1b092b64c9f5db8f11558f9dd4009a1b", subpath = "tree-sitter-markdown" }
888+
889+[[language]]
890+name = "markdown.inline"
891+scope = "source.markdown.inline"
892+injection-regex = "markdown\\.inline"
893+file-types = []
894+roots = []
895+grammar = "markdown_inline"
896+
897+[[grammar]]
898+name = "markdown_inline"
899+source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "142a5b4a1b092b64c9f5db8f11558f9dd4009a1b", subpath = "tree-sitter-markdown-inline" }
888
900
889[[language]]
901[[language]]
890name = "dart"
902name = "dart"
runtime/queries/markdown.inline/highlights.scmnew file+39
@@ -0,0 +1,39 @@
1+;; From nvim-treesitter/nvim-treesitter
2+[
3+ (code_span)
4+ (link_title)
5+] @markup.raw.inline
6+
7+[
8+ (emphasis_delimiter)
9+ (code_span_delimiter)
10+] @punctuation.bracket
11+
12+(emphasis) @markup.italic
13+
14+(strong_emphasis) @markup.bold
15+
16+(strikethrough) @markup.strikethrough
17+
18+[
19+ (link_destination)
20+ (uri_autolink)
21+] @markup.link.url
22+
23+[
24+ (link_text)
25+ (image_description)
26+] @markup.link.text
27+
28+(link_label) @markup.link.label
29+
30+[
31+ (backslash_escape)
32+ (hard_line_break)
33+] @constant.character.escape
34+
35+(image ["[" "]" "(" ")"] @punctuation.bracket)
36+(image "!" @punctuation.special)
37+(inline_link ["[" "]" "(" ")"] @punctuation.bracket)
38+(shortcut_link ["[" "]"] @punctuation.bracket)
39+
runtime/queries/markdown.inline/injections.scmnew file+2
@@ -0,0 +1,2 @@
1+
2+((html_tag) @injection.content (#set! injection.language "html"))
runtime/queries/markdown/highlights.scm+30−31
@@ -1,54 +1,53 @@
1−(setext_heading (heading_content) @markup.heading.1 (setext_h1_underline) @markup.heading.marker)
2−(setext_heading (heading_content) @markup.heading.2 (setext_h2_underline) @markup.heading.marker)
3
1
2+(setext_heading (paragraph) @markup.heading.1 (setext_h1_underline) @markup.heading.marker)
3+(setext_heading (paragraph) @markup.heading.2 (setext_h2_underline) @markup.heading.marker)
4+
4−(atx_heading (atx_h1_marker) @markup.heading.marker (heading_content) @markup.heading.1)
5+(atx_heading (atx_h1_marker) @markup.heading.marker (inline) @markup.heading.1)
5−(atx_heading (atx_h2_marker) @markup.heading.marker (heading_content) @markup.heading.2)
6+(atx_heading (atx_h2_marker) @markup.heading.marker (inline) @markup.heading.2)
6−(atx_heading (atx_h3_marker) @markup.heading.marker (heading_content) @markup.heading.3)
7+(atx_heading (atx_h3_marker) @markup.heading.marker (inline) @markup.heading.3)
7−(atx_heading (atx_h4_marker) @markup.heading.marker (heading_content) @markup.heading.4)
8+(atx_heading (atx_h4_marker) @markup.heading.marker (inline) @markup.heading.4)
8−(atx_heading (atx_h5_marker) @markup.heading.marker (heading_content) @markup.heading.5)
9+(atx_heading (atx_h5_marker) @markup.heading.marker (inline) @markup.heading.5)
9−(atx_heading (atx_h6_marker) @markup.heading.marker (heading_content) @markup.heading.6)
10+(atx_heading (atx_h6_marker) @markup.heading.marker (inline) @markup.heading.6)
10
11
11[
12[
12 (indented_code_block)
13 (indented_code_block)
13− (code_fence_content)
14+ (fenced_code_block)
14] @markup.raw.block
15] @markup.raw.block
15
16
16−(block_quote) @markup.quote
17+(info_string) @label
17−
18−(code_span) @markup.raw.inline
19−
20−(emphasis) @markup.italic
21−
22−(strong_emphasis) @markup.bold
23
18
24−(link_destination) @markup.link.url
19+[
25−(link_label) @markup.link.label
20+ (fenced_code_block_delimiter)
21+] @punctuation.bracket
26
22
27−(info_string) @label
23+[
24+ (link_destination)
25+] @markup.link.url
28
26
29[
27[
30− (link_text)
28+ (link_label)
31− (image_description)
32−] @markup.link.text
29+] @markup.link.label
33
30
34[
31[
35 (list_marker_plus)
32 (list_marker_plus)
36 (list_marker_minus)
33 (list_marker_minus)
37 (list_marker_star)
34 (list_marker_star)
38−] @markup.list.numbered
35+] @markup.list.unnumbered
39
36
40[
37[
41 (list_marker_dot)
38 (list_marker_dot)
42 (list_marker_parenthesis)
39 (list_marker_parenthesis)
43−] @markup.list.unnumbered
40+] @markup.list.numbered
41+
42+(thematic_break) @punctuation.delimiter
44
43
45[
44[
46− (backslash_escape)
45+ (block_continuation)
47− (hard_line_break)
46+ (block_quote_marker)
48−] @constant.character.escape
47+] @punctuation.special
49
48
50−(thematic_break) @punctuation.delimiter
49+[
50+ (backslash_escape)
51+] @string.escape
51
52
52−(inline_link ["[" "]" "(" ")"] @punctuation.bracket)
53+(block_quote) @markup.quote
53−(image ["[" "]" "(" ")"] @punctuation.bracket)
54−(fenced_code_block_delimiter) @punctuation.bracket
runtime/queries/markdown/injections.scm+14−8
@@ -1,9 +1,15 @@
1+; From nvim-treesitter/nvim-treesitter
2+
1(fenced_code_block
3(fenced_code_block
4+ (info_string
2− (info_string) @injection.language
5+ (language) @injection.language)
3− (code_fence_content) @injection.content
6+ (code_fence_content) @injection.content (#set! injection.include-unnamed-children))
4− (#set! injection.include-children))
7+
5−
6−((html_block) @injection.content
8+((html_block) @injection.content (#set! injection.language "html") (#set! injection.include-unnamed-children))
7− (#set! injection.language "html"))
9+
8−((html_tag) @injection.content
10+([
9− (#set! injection.language "html"))
11+ (minus_metadata)
12+ (plus_metadata)
13+] @injection.content (#set! injection.language "yaml") (#set! injection.include-unnamed-children))
14+
15+((inline) @injection.content (#set! injection.language "markdown.inline") (#set! injection.include-unnamed-children))