nvim-treesitter/queries/markdown_inline/highlights.scm
Matthias Deiml 002084b1be
feat(markdown)!: switch to split parser (#3048)
* switch to split markdown parser with separate block and inline parsers to improve performance
* add exclude_children! directive (useful for something like Injected markdown incorrectly highlights indented docstrings #2212)
* split markdown queries into block and inline ones and add the injection for inline into block grammar
* add include_dir option to parser configs (needed because the two grammars don't live in the repos root directory)

BREAKING CHANGE: downstream queries need to be adapted to new parser
2022-06-26 18:02:29 +02:00

67 lines
1 KiB
Scheme

;; From MDeiml/tree-sitter-markdown
[
(code_span)
(link_title)
] @text.literal
[
(emphasis_delimiter)
(code_span_delimiter)
] @punctuation.delimiter
(emphasis) @text.emphasis
(strong_emphasis) @text.strong
[
(link_destination)
(uri_autolink)
] @text.uri
[
(link_label)
(link_text)
(image_description)
] @text.reference
[
(backslash_escape)
(hard_line_break)
] @string.escape
; "(" not part of query because of
; https://github.com/nvim-treesitter/nvim-treesitter/issues/2206
; TODO: Find better fix for this
(image ["!" "[" "]" "("] @punctuation.delimiter)
(inline_link ["[" "]" "("] @punctuation.delimiter)
(shortcut_link ["[" "]"] @punctuation.delimiter)
([
(code_span_delimiter)
(emphasis_delimiter)
] @conceal
(#set! conceal ""))
; Conceal inline links
(inline_link
[
"["
"]"
"("
(link_destination)
")"
] @conceal
(#set! conceal ""))
; Conceal image links
(image
[
"!"
"["
"]"
"("
(link_destination)
")"
] @conceal
(#set! conceal ""))