Commit graph

17 commits

Author SHA1 Message Date
Christian Clason
a8fa3047b5 fix(highlights): use markup.raw.delimiter for fences 2024-01-20 13:04:29 +01:00
Riley Bruins
88261266de
fix(markdown_inline): prioritize link URI (#5935) 2024-01-20 19:00:37 +09:00
Pham Huy Hoang
57a8acf0c4 chore: query formatting 2024-01-19 16:58:37 +01:00
Christian Clason
1ae9b0e455 feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.

Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.

Specifically:

* tree-sitter "standard capture names"
  (3f44b89685/highlight/src/lib.rs (L20-L72)):

  - `@parameter` -> `@variable.parameter`
  - `@field` -> `@variable.member`
  - `@namespace` -> `@module`
  - `@float` -> `@number.float`
  - `@symbol` -> `@string.special.symbol`
  - `@string.regex` -> `@string.regexp`
  - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
  - `@text.title` -> `@markup.heading`
  - `@text.literal` -> `@markup.raw`
  - `@text.reference` -> `@markup.link`
  - `@text.uri` -> `@markup.link.url` (in markup links)
  - `@string.special` -> `@markup.link.label` (non-url links)
  - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)

* Helix captures
  (https://docs.helix-editor.com/master/themes.html#syntax-highlighting):

  - `@method` -> `@function.method`
  - `@method.call` -> `@function.method.call`
  - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
  - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
  - `@text.uri` -> `@string.special.url` (outside markup)
  - `@preproc` -> `@keyword.directive`
  - `@define` -> `@keyword.directive`(`.define`?)
  - `@storageclass` -> `@keyword.storage`
  - `@conditional` -> `@keyword.conditional`
  - `@debug` -> `@keyword.debug`
  - `@exception` -> `@keyword.exception`
  - `@include` -> `@keyword.import`
  - `@repeat` -> `@keyword.repeat`

* cleanup

  - remove some redundant `@conceal` (but still allow it for conceal-only patterns)
  - remove obsolete `@error` (syntax linting is out of scope for this repo)
  - sort, cleanup capture list in `CONTRIBUTING.md`
2024-01-19 16:58:37 +01:00
Zhuofeng Wang
e277ca9dec fix(markdown_inline): latex highlight injection (#5397)
The `injection.include-children` is needed in markdown_inline parser.
2024-01-05 10:58:35 +01:00
Maria José Solano
eb0f975bf2 feat(markdown): conceal triple backticks and HTML entities 2023-09-17 23:16:53 +02:00
Pham Huy Hoang
bfb4601f48
refactor: remove include-children from queries (#5226)
These `include-children` were to alleviate an issue with empty range language tree, which has been fixed for Neovim nightly/Neovim 0.9.2
2023-09-12 08:36:50 +02:00
Pham Huy Hoang
78b54eb7f6 chore(injections)!: update injection syntax to 0.9
Since 0.9, @lang syntax is still available as fallback but will soon be deprecated.
Because of that, new syntax should be adopted once 0.9 becomes the
baseline requirements for nvim-treesitter

- update health check
- update doc
2023-08-12 17:34:15 +02:00
Repetitive
254f3da683 fix(markdown_inline): don't spellcheck shortlinks 2023-07-02 14:22:27 +02:00
Christian Clason
680807fa6a highlights(markup): distinguish heading level in queries
also add a few queries from Helix and remove controversial
code block conceal in Markdown
2023-05-13 16:50:32 +02:00
Pham Huy Hoang
4fe6b4c07f fix: add @combined to markdown html 2023-05-03 16:23:09 -04:00
Jaehwang Jung
a57d2a599b feat(markdown_inline): add @nospell where appropriate 2023-04-08 15:34:06 -07:00
Christian Clason
24d5be6e71 feat(markdown): add latex injections
added in https://github.com/MDeiml/tree-sitter-markdown/pull/71
2023-02-05 08:29:45 -08:00
Christian Clason
7e4a7c4508 markdown: add strikethrough and blockquote captures 2023-01-14 11:52:25 +01:00
Josef Litoš
46cace42fa highlights(markdown_inline): added ')' to links 2023-01-04 12:17:33 +01:00
Ben Weedon
cea9c5941d Conceal reference and shortcut links in markdown
This change conceals `full_reference_link`, `collapsed_reference_link`,
and `shortcut_link` similarly to the `markdown_inline` query file
already conceals `inline_link` and `image`.

 ## Test markdown contents

```markdown
Some text before the link [full reference link text][link label] and now some
text after the link onto a new line.

Some text before the link [collapsed reference link text][] and now some text
after the link onto a new line.

Some text before the link [shortcut link text] and now some text after the link
onto a new line.
```

 ## Test markdown concealed screenshot

Closes #3267
2022-08-11 14:36:44 -07:00
Matthias Deiml
002084b1be
feat(markdown)!: switch to split parser (#3048)
* switch to split markdown parser with separate block and inline parsers to improve performance
* add exclude_children! directive (useful for something like Injected markdown incorrectly highlights indented docstrings #2212)
* split markdown queries into block and inline ones and add the injection for inline into block grammar
* add include_dir option to parser configs (needed because the two grammars don't live in the repos root directory)

BREAKING CHANGE: downstream queries need to be adapted to new parser
2022-06-26 18:02:29 +02:00