2022-06-26 18:02:29 +02:00
|
|
|
;; From MDeiml/tree-sitter-markdown
|
|
|
|
|
[
|
|
|
|
|
(code_span)
|
|
|
|
|
(link_title)
|
2023-04-08 14:11:24 +09:00
|
|
|
] @text.literal @nospell
|
2022-06-26 18:02:29 +02:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
(emphasis_delimiter)
|
|
|
|
|
(code_span_delimiter)
|
|
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
|
|
|
|
(emphasis) @text.emphasis
|
|
|
|
|
|
|
|
|
|
(strong_emphasis) @text.strong
|
|
|
|
|
|
2023-01-13 18:34:26 +01:00
|
|
|
(strikethrough) @text.strike
|
|
|
|
|
|
2022-06-26 18:02:29 +02:00
|
|
|
[
|
|
|
|
|
(link_destination)
|
|
|
|
|
(uri_autolink)
|
2023-04-08 14:11:24 +09:00
|
|
|
] @text.uri @nospell
|
2022-06-26 18:02:29 +02:00
|
|
|
|
2023-07-01 11:19:48 +02:00
|
|
|
(shortcut_link (link_text) @nospell)
|
|
|
|
|
|
2022-06-26 18:02:29 +02:00
|
|
|
[
|
|
|
|
|
(link_label)
|
|
|
|
|
(link_text)
|
|
|
|
|
(image_description)
|
|
|
|
|
] @text.reference
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
(backslash_escape)
|
|
|
|
|
(hard_line_break)
|
|
|
|
|
] @string.escape
|
|
|
|
|
|
2023-05-13 11:23:50 +02:00
|
|
|
(image "!" @punctuation.special)
|
|
|
|
|
(image ["[" "]" "(" ")"] @punctuation.bracket)
|
|
|
|
|
(inline_link ["[" "]" "(" ")"] @punctuation.bracket)
|
|
|
|
|
(shortcut_link ["[" "]"] @punctuation.bracket)
|
2022-06-26 18:02:29 +02:00
|
|
|
|
2023-01-13 18:34:26 +01:00
|
|
|
; Conceal codeblock and text style markers
|
2022-06-26 18:02:29 +02:00
|
|
|
([
|
|
|
|
|
(code_span_delimiter)
|
|
|
|
|
(emphasis_delimiter)
|
|
|
|
|
] @conceal
|
|
|
|
|
(#set! conceal ""))
|
|
|
|
|
|
|
|
|
|
; Conceal inline links
|
|
|
|
|
(inline_link
|
|
|
|
|
[
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
"("
|
2022-08-09 22:24:13 -07:00
|
|
|
(link_destination)
|
2022-06-26 18:02:29 +02:00
|
|
|
")"
|
2022-08-09 22:24:13 -07:00
|
|
|
] @conceal
|
|
|
|
|
(#set! conceal ""))
|
2022-06-26 18:02:29 +02:00
|
|
|
|
|
|
|
|
; Conceal image links
|
|
|
|
|
(image
|
|
|
|
|
[
|
|
|
|
|
"!"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
"("
|
2022-08-09 22:24:13 -07:00
|
|
|
(link_destination)
|
2022-06-26 18:02:29 +02:00
|
|
|
")"
|
2022-08-09 22:24:13 -07:00
|
|
|
] @conceal
|
|
|
|
|
(#set! conceal ""))
|
|
|
|
|
|
|
|
|
|
; Conceal full reference links
|
|
|
|
|
(full_reference_link
|
|
|
|
|
[
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
(link_label)
|
|
|
|
|
] @conceal
|
|
|
|
|
(#set! conceal ""))
|
|
|
|
|
|
|
|
|
|
; Conceal collapsed reference links
|
|
|
|
|
(collapsed_reference_link
|
|
|
|
|
[
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
] @conceal
|
|
|
|
|
(#set! conceal ""))
|
|
|
|
|
|
|
|
|
|
; Conceal shortcut links
|
|
|
|
|
(shortcut_link
|
|
|
|
|
[
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
] @conceal
|
2022-06-26 18:02:29 +02:00
|
|
|
(#set! conceal ""))
|
2023-09-17 14:13:50 -07:00
|
|
|
|
|
|
|
|
;; Replace common HTML entities.
|
|
|
|
|
((entity_reference) @conceal (#eq? @conceal " ") (#set! conceal ""))
|
|
|
|
|
((entity_reference) @conceal (#eq? @conceal "<") (#set! conceal "<"))
|
|
|
|
|
((entity_reference) @conceal (#eq? @conceal ">") (#set! conceal ">"))
|
|
|
|
|
((entity_reference) @conceal (#eq? @conceal "&") (#set! conceal "&"))
|
|
|
|
|
((entity_reference) @conceal (#eq? @conceal """) (#set! conceal "\""))
|
|
|
|
|
((entity_reference) @conceal (#any-of? @conceal " " " ") (#set! conceal " "))
|