Skip to content

Commit

Permalink
Fix HTML injection within markdown (helix-editor#5265)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
the-mikedavis authored and Frederik Vestre committed Feb 6, 2023
1 parent 212a4c7 commit 33f827e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion runtime/queries/markdown/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
(language) @injection.language)
(code_fence_content) @injection.content (#set! injection.include-unnamed-children))

((html_block) @injection.content (#set! injection.language "html") (#set! injection.include-unnamed-children))
((html_block) @injection.content
(#set! injection.language "html")
(#set! injection.include-unnamed-children)
(#set! injection.combined))

((pipe_table_cell) @injection.content (#set! injection.language "markdown.inline") (#set! injection.include-unnamed-children))

Expand Down

0 comments on commit 33f827e

Please sign in to comment.