feat(markdown): configured aliases for fenced code block languages (#4659)

* feat(markdown): configured aliases for languages

* refactor: use vim.treesitter.match

* refactor: rename local vars

* fix: query syntax
This commit is contained in:
Benny Powers 2023-04-18 15:51:14 +03:00 committed by GitHub
parent c79c37927b
commit cdc45ac6ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 14 deletions

View file

@ -1,8 +1,11 @@
(fenced_code_block
(info_string
(language) @language)
(#not-match? @language "elm")
(code_fence_content) @content (#exclude_children! @content))
(language) @_lang)
(#not-match? @_lang "elm") ; prevent segfault when using elm parser
(code_fence_content)
@content
(#set-lang-from-info-string! @_lang)
(#exclude_children! @content))
((html_block) @html)