highlights(markup): distinguish heading level in queries

also add a few queries from Helix and remove controversial
code block conceal in Markdown
This commit is contained in:
Christian Clason 2023-05-13 11:23:50 +02:00
parent 15300c1a10
commit 680807fa6a
5 changed files with 43 additions and 53 deletions

View file

@ -1,17 +1,13 @@
;From MDeiml/tree-sitter-markdown
(atx_heading (inline) @text.title)
(setext_heading (paragraph) @text.title)
;From MDeiml/tree-sitter-markdown & Helix
(setext_heading (paragraph) @text.title.1 (setext_h1_underline) @text.title.1.marker)
(setext_heading (paragraph) @text.title.2 (setext_h2_underline) @text.title.2.marker)
[
(atx_h1_marker)
(atx_h2_marker)
(atx_h3_marker)
(atx_h4_marker)
(atx_h5_marker)
(atx_h6_marker)
(setext_h1_underline)
(setext_h2_underline)
] @punctuation.special
(atx_heading (atx_h1_marker) @text.title.1.marker (inline) @text.title.1)
(atx_heading (atx_h2_marker) @text.title.2.marker (inline) @text.title.2)
(atx_heading (atx_h3_marker) @text.title.3.marker (inline) @text.title.3)
(atx_heading (atx_h4_marker) @text.title.4.marker (inline) @text.title.4)
(atx_heading (atx_h5_marker) @text.title.5.marker (inline) @text.title.5)
(atx_heading (atx_h6_marker) @text.title.6.marker (inline) @text.title.6)
[
(link_title)
@ -19,6 +15,8 @@
(fenced_code_block)
] @text.literal
(info_string) @label
(pipe_table_header (pipe_table_cell) @text.title)
(pipe_table_header "|" @punctuation.special)
@ -64,10 +62,4 @@
(backslash_escape)
] @string.escape
([
(info_string)
(fenced_code_block_delimiter)
] @conceal
(#set! conceal ""))
(inline) @spell