Commit Graph

17 Commits

Author SHA1 Message Date
Timothy DeHerrera
9c6c63a2be
inject language based on file extension & shebang (#3970)
* inject language based on file extension

Nodes can now be captured with "injection.filename". If this capture
contains a valid file extension known to Helix, then the content will
be highlighted as that language.

* inject language by shebang

Nodes can now be captured with "injection.shebang". If this capture
contains a valid shebang line known to Helix, then the content will
be highlighted as the language the shebang calls for.

* add documentation for language injection

* nix: fix highlights

The `@` is now highlighted properly on either side of the function arg.

Also, extending the phases with `buildPhase = prev.buildPhase + ''''`
is now highlighted properly.

Fix highlighting of `''$` style escapes (requires tree-sitter-nix bump)

Fix `inherit` highlighting.

* simplify injection_for_match

Split out injection pair logic into its own method to make the overall
flow easier to follow.

Also transform the top-level function into a method on a
HighlightConfiguration.

* markdown: add shebang injection query
2023-04-28 18:21:34 +09:00
Erasin Wang
851ac6cdd3
Add theme keys for (un)checked markup list items (#6434) 2023-03-25 11:41:31 -05:00
Matthias Deiml
0cbb61c3a4
Improve markdown highlights and add latex injection (#6100) 2023-02-25 12:40:02 -06:00
Michael Davis
7905086b55
Fix HTML injection within markdown (#5265)
HTML nodes should be combined injections in the markdown block
grammar. When nodes are together the highlighting works properly but
when there is markdown content between HTML nodes like in a `<details>`
tag, the highlighting of the closing tag breaks since tree-sitter-html
looks for opening and closing tags.
2022-12-23 10:21:02 +09:00
David
18f6ec7a8e
Update treesitter markdown (#4078)
* Update treesitter markdown

* Update inline and add table injections
2022-10-03 23:14:16 +09:00
Erasin
1eeca10675
Fix Markdown Metadata (#3400) 2022-08-12 09:27:50 -05:00
Matthias Deiml
ea04220874
Use split_parser branch for markdown grammar (#3108) 2022-08-06 10:56:48 -05:00
Michael Davis
c5600c9c01 markdown: limit raw block highlight to code fence content 2022-07-01 11:04:23 +02:00
Michael Davis
ca82cd86e6 markdown: highlight punctuation 2022-07-01 11:04:23 +02:00
Michael Davis
42d780b103
add tree-sitter-edoc (#2640)
* add tree-sitter-edoc

* fix escape character capture in markdown queries

* add field negation operator "!" to tsq highlights
2022-06-03 07:41:17 +08:00
ChrHorn
b38c268097
fix Markdown list highlighting (#2401) 2022-05-07 11:26:34 +09:00
Alex
d5ba0b5162
Allow separate styles for markup headings (#1618)
* update markdown highlighting to use separate heading themes

* remove markdown theme scopes in ui
2022-02-21 16:45:48 +09:00
Michael Davis
b799b0d50e
capture markdown link text as markup.link.text (#1456) 2022-01-09 00:27:50 +09:00
Flakebi
0dab6c8c17 Fix markdown code-block highlighting
Markdown code blocks should be highlighted as a single block, so set
injection.include-children.
2022-01-01 17:36:12 +08:00
Gokul Soumya
7c01d92653 Add link and quote queries for markdown
- Rename markup.underline.link to markup.link.url
- Add markup.link.label
- Add markup.quote

(The constructor theme scope was missing from the
docs, so unrelated to this commit).
2021-12-19 15:23:39 +09:00
Blaž Hrastnik
ac4b72fcc8 Add injections query for markdown 2021-12-15 18:03:02 +09:00
Blaž Hrastnik
49e0678741 Add markdown grammar
Fixes #215
2021-12-15 00:50:11 +09:00