Add markdown grammar

Fixes #215
imgbot
Blaž Hrastnik 3 years ago
parent 6da2174e14
commit 49e0678741

4
.gitmodules vendored

@ -150,3 +150,7 @@
path = helix-syntax/languages/tree-sitter-llvm path = helix-syntax/languages/tree-sitter-llvm
url = https://github.com/benwilliamgraham/tree-sitter-llvm url = https://github.com/benwilliamgraham/tree-sitter-llvm
shallow = true shallow = true
[submodule "helix-syntax/languages/tree-sitter-markdown"]
path = helix-syntax/languages/tree-sitter-markdown
url = https://github.com/MDeiml/tree-sitter-markdown
shallow = true

@ -0,0 +1 @@
Subproject commit ad8c32917a16dfbb387d1da567bf0c3fb6fffde2

@ -421,3 +421,12 @@ roots = []
file-types = ["ll"] file-types = ["ll"]
comment-token = ";" comment-token = ";"
indent = { tab-width = 2, unit = " " } indent = { tab-width = 2, unit = " " }
[[language]]
name = "markdown"
scope = "source.md"
injection-regex = "md|markdown"
file-types = ["md"]
roots = []
indent = { tab-width = 2, unit = " " }

@ -0,0 +1,35 @@
[
(atx_heading)
(setext_heading)
] @markup.heading
(code_fence_content) @none
[
(indented_code_block)
(fenced_code_block)
] @markup.raw.block
(code_span) @markup.raw.inline
(emphasis) @markup.italic
(strong_emphasis) @markup.bold
(link_destination) @markup.underline.link
; (link_label) @markup.label ; TODO: rename
[
(list_marker_plus)
(list_marker_minus)
(list_marker_star)
(list_marker_dot)
(list_marker_parenthesis)
] @punctuation.special
[
(backslash_escape)
(hard_line_break)
] @string.character.escape

@ -25,7 +25,7 @@
((attribute ((attribute
(attribute_name) @_attr (attribute_name) @_attr
(quoted_attribute_value (attribute_value) @markup.undeline.link)) (quoted_attribute_value (attribute_value) @markup.underline.link))
(#match? @_attr "^(href|src)$")) (#match? @_attr "^(href|src)$"))
(tag_name) @tag (tag_name) @tag

@ -28,6 +28,12 @@ string = "silver"
# used for lifetimes # used for lifetimes
label = "honey" label = "honey"
"markup.heading" = "lilac"
"markup.bold" = { modifiers = ["bold"] }
"markup.italic" = { modifiers = ["italic"] }
"markup.underline.link" = { fg = "silver", modifiers = ["underlined"] }
"markup.raw" = "almond"
# TODO: diferentiate doc comment # TODO: diferentiate doc comment
# concat (ERROR) @error.syntax and "MISSING ;" selectors for errors # concat (ERROR) @error.syntax and "MISSING ;" selectors for errors

Loading…
Cancel
Save