|
| 1 | +import type { Lang } from "../lang"; |
| 2 | + |
| 3 | +const query = ` |
| 4 | +(setext_heading |
| 5 | + (paragraph) @type |
| 6 | + [(setext_h1_underline) (setext_h2_underline)] @punctuation.special) |
| 7 | +
|
| 8 | +(atx_heading) @type |
| 9 | +[ |
| 10 | + (atx_h1_marker) |
| 11 | + (atx_h2_marker) |
| 12 | + (atx_h3_marker) |
| 13 | + (atx_h4_marker) |
| 14 | + (atx_h5_marker) |
| 15 | + (atx_h6_marker) |
| 16 | +] @punctuation.special |
| 17 | +
|
| 18 | +(info_string) @type |
| 19 | +(indented_code_block) @string |
| 20 | +(fenced_code_block) @string |
| 21 | +(fenced_code_block_delimiter) @punctuation.special |
| 22 | +
|
| 23 | +[ |
| 24 | + (link_destination) |
| 25 | + (link_title) |
| 26 | + (link_label) |
| 27 | +] @string.special |
| 28 | +
|
| 29 | +[ |
| 30 | + (list_marker_plus) |
| 31 | + (list_marker_minus) |
| 32 | + (list_marker_star) |
| 33 | + (list_marker_dot) |
| 34 | + (list_marker_parenthesis) |
| 35 | + (task_list_marker_unchecked) |
| 36 | + (task_list_marker_checked) |
| 37 | +] @punctuation.special |
| 38 | +
|
| 39 | +(thematic_break) @punctuation.special |
| 40 | +(block_quote) @comment |
| 41 | +(block_quote_marker) @punctuation.special |
| 42 | +(backslash_escape) @string.escape |
| 43 | +
|
| 44 | +((html_block) @injection.content.html) |
| 45 | +
|
| 46 | +([ |
| 47 | + (inline) |
| 48 | + (pipe_table_cell) |
| 49 | +] @injection.content.markdown_inline) |
| 50 | +
|
| 51 | +(fenced_code_block |
| 52 | + (info_string (language) @_language) |
| 53 | + (code_fence_content) @injection.content.javascript |
| 54 | + (#any-of? @_language "js" "jsx" "javascript")) |
| 55 | +
|
| 56 | +(fenced_code_block |
| 57 | + (info_string (language) @_language) |
| 58 | + (code_fence_content) @injection.content.typescript |
| 59 | + (#any-of? @_language "ts" "tsx" "typescript")) |
| 60 | +
|
| 61 | +(fenced_code_block |
| 62 | + (info_string (language) @_language) |
| 63 | + (code_fence_content) @injection.content.python |
| 64 | + (#any-of? @_language "py" "python")) |
| 65 | +
|
| 66 | +(fenced_code_block |
| 67 | + (info_string (language) @_language) |
| 68 | + (code_fence_content) @injection.content.rust |
| 69 | + (#eq? @_language "rust")) |
| 70 | +
|
| 71 | +(fenced_code_block |
| 72 | + (info_string (language) @_language) |
| 73 | + (code_fence_content) @injection.content.bash |
| 74 | + (#any-of? @_language "bash" "sh" "shell")) |
| 75 | +
|
| 76 | +(fenced_code_block |
| 77 | + (info_string (language) @_language) |
| 78 | + (code_fence_content) @injection.content.json |
| 79 | + (#eq? @_language "json")) |
| 80 | +
|
| 81 | +(fenced_code_block |
| 82 | + (info_string (language) @_language) |
| 83 | + (code_fence_content) @injection.content.yaml |
| 84 | + (#any-of? @_language "yaml" "yml")) |
| 85 | +
|
| 86 | +(fenced_code_block |
| 87 | + (info_string (language) @_language) |
| 88 | + (code_fence_content) @injection.content.html |
| 89 | + (#eq? @_language "html")) |
| 90 | +
|
| 91 | +(fenced_code_block |
| 92 | + (info_string (language) @_language) |
| 93 | + (code_fence_content) @injection.content.css |
| 94 | + (#eq? @_language "css")) |
| 95 | +`; |
| 96 | + |
| 97 | +const foldsQuery = ` |
| 98 | +[ |
| 99 | + (section) |
| 100 | + (fenced_code_block) |
| 101 | + (block_quote) |
| 102 | + (list) |
| 103 | +] @fold |
| 104 | +`; |
| 105 | + |
| 106 | +const indent = { width: 2, unit: " " }; |
| 107 | +const comment = ""; |
| 108 | + |
| 109 | +export default { |
| 110 | + query, foldsQuery, indent, comment |
| 111 | +} satisfies Lang; |
0 commit comments