|
| 1 | +;From MDeiml/tree-sitter-markdown & Helix |
| 2 | +(setext_heading |
| 3 | + (paragraph) @markup.heading.1 |
| 4 | + (setext_h1_underline) @markup.heading.1) |
| 5 | + |
| 6 | +(setext_heading |
| 7 | + (paragraph) @markup.heading.2 |
| 8 | + (setext_h2_underline) @markup.heading.2) |
| 9 | + |
| 10 | +(atx_heading |
| 11 | + (atx_h1_marker)) @markup.heading.1 |
| 12 | + |
| 13 | +(atx_heading |
| 14 | + (atx_h2_marker)) @markup.heading.2 |
| 15 | + |
| 16 | +(atx_heading |
| 17 | + (atx_h3_marker)) @markup.heading.3 |
| 18 | + |
| 19 | +(atx_heading |
| 20 | + (atx_h4_marker)) @markup.heading.4 |
| 21 | + |
| 22 | +(atx_heading |
| 23 | + (atx_h5_marker)) @markup.heading.5 |
| 24 | + |
| 25 | +(atx_heading |
| 26 | + (atx_h6_marker)) @markup.heading.6 |
| 27 | + |
| 28 | +(info_string) @label |
| 29 | + |
| 30 | +(pipe_table_header |
| 31 | + (pipe_table_cell) @markup.heading) |
| 32 | + |
| 33 | +(pipe_table_header |
| 34 | + "|" @punctuation.special) |
| 35 | + |
| 36 | +(pipe_table_row |
| 37 | + "|" @punctuation.special) |
| 38 | + |
| 39 | +(pipe_table_delimiter_row |
| 40 | + "|" @punctuation.special) |
| 41 | + |
| 42 | +(pipe_table_delimiter_cell) @punctuation.special |
| 43 | + |
| 44 | +; Code blocks (conceal backticks and language annotation) |
| 45 | +(indented_code_block) @markup.raw.block |
| 46 | + |
| 47 | +((fenced_code_block) @markup.raw.block |
| 48 | + (#set! priority 90)) |
| 49 | + |
| 50 | +(fenced_code_block |
| 51 | + (fenced_code_block_delimiter) @markup.raw.block |
| 52 | + (#set! conceal "")) |
| 53 | + |
| 54 | +(fenced_code_block |
| 55 | + (info_string |
| 56 | + (language) @label |
| 57 | + (#set! conceal ""))) |
| 58 | + |
| 59 | +(link_destination) @markup.link.url |
| 60 | + |
| 61 | +[ |
| 62 | + (link_title) |
| 63 | + (link_label) |
| 64 | +] @markup.link.label |
| 65 | + |
| 66 | +((link_label) |
| 67 | + . |
| 68 | + ":" @punctuation.delimiter) |
| 69 | + |
| 70 | +[ |
| 71 | + (list_marker_plus) |
| 72 | + (list_marker_minus) |
| 73 | + (list_marker_star) |
| 74 | + (list_marker_dot) |
| 75 | + (list_marker_parenthesis) |
| 76 | +] @markup.list |
| 77 | + |
| 78 | +; NOTE: The following has been commented out due to issues with spaces in the |
| 79 | +; list marker nodes generated by the parser. If those spaces ever get captured |
| 80 | +; by a different node (e.g. block_continuation) we can safely re-add these |
| 81 | +; conceals. |
| 82 | +; ;; Conceal bullet points |
| 83 | +; ([(list_marker_plus) (list_marker_star)] |
| 84 | +; @punctuation.special |
| 85 | +; (#offset! @punctuation.special 0 0 0 -1) |
| 86 | +; (#set! conceal "•")) |
| 87 | +; ([(list_marker_plus) (list_marker_star)] |
| 88 | +; @punctuation.special |
| 89 | +; (#any-of? @punctuation.special "+" "*") |
| 90 | +; (#set! conceal "•")) |
| 91 | +; ((list_marker_minus) |
| 92 | +; @punctuation.special |
| 93 | +; (#offset! @punctuation.special 0 0 0 -1) |
| 94 | +; (#set! conceal "—")) |
| 95 | +; ((list_marker_minus) |
| 96 | +; @punctuation.special |
| 97 | +; (#eq? @punctuation.special "-") |
| 98 | +; (#set! conceal "—")) |
| 99 | +(thematic_break) @punctuation.special |
| 100 | + |
| 101 | +(task_list_marker_unchecked) @markup.list.unchecked |
| 102 | + |
| 103 | +(task_list_marker_checked) @markup.list.checked |
| 104 | + |
| 105 | +((block_quote) @markup.quote |
| 106 | + (#set! priority 90)) |
| 107 | + |
| 108 | +([ |
| 109 | + (plus_metadata) |
| 110 | + (minus_metadata) |
| 111 | +] @keyword.directive |
| 112 | + (#set! priority 90)) |
| 113 | + |
| 114 | +[ |
| 115 | + (block_continuation) |
| 116 | + (block_quote_marker) |
| 117 | +] @punctuation.special |
| 118 | + |
| 119 | +(backslash_escape) @string.escape |
| 120 | + |
| 121 | +(inline) @spell |
0 commit comments