Skip to content

Commit

Permalink
Improve markdown highlights and add latex injection (helix-editor#6100)
Browse files Browse the repository at this point in the history
  • Loading branch information
MDeiml authored and estin committed Mar 4, 2023
1 parent 0d9d83d commit 72ab510
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ indent = { tab-width = 2, unit = " " }

[[grammar]]
name = "markdown"
source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "a7de4be29783a6e25f3240c90afea52f2417faa3", subpath = "tree-sitter-markdown" }
source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "7e7aa9a25ca9729db9fe22912f8f47bdb403a979", subpath = "tree-sitter-markdown" }

[[language]]
name = "markdown.inline"
Expand All @@ -1038,7 +1038,7 @@ grammar = "markdown_inline"

[[grammar]]
name = "markdown_inline"
source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "a7de4be29783a6e25f3240c90afea52f2417faa3", subpath = "tree-sitter-markdown-inline" }
source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "7e7aa9a25ca9729db9fe22912f8f47bdb403a979", subpath = "tree-sitter-markdown-inline" }

[[language]]
name = "dart"
Expand Down
2 changes: 2 additions & 0 deletions runtime/queries/markdown.inline/injections.scm
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

((html_tag) @injection.content (#set! injection.language "html") (#set! injection.include-unnamed-children))

((latex_block) @injection.content (#set! injection.language "latex") (#set! injection.include-unnamed-children))
8 changes: 7 additions & 1 deletion runtime/queries/markdown/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
(list_marker_parenthesis)
] @markup.list.numbered

(thematic_break) @punctuation.delimiter
(thematic_break) @punctuation.special

[
(block_continuation)
Expand All @@ -51,3 +51,9 @@
] @string.escape

(block_quote) @markup.quote

(pipe_table_row
"|" @punctuation.special)
(pipe_table_header
"|" @punctuation.special)
(pipe_table_delimiter_row) @punctuation.special

0 comments on commit 72ab510

Please sign in to comment.