From f5601bbd402129c8b0df4422aa329edfcd40011e Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 22 Dec 2022 15:40:22 -0600 Subject: [PATCH] Fix HTML injection within markdown 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 `
` tag, the highlighting of the closing tag breaks since tree-sitter-html looks for opening and closing tags. --- runtime/queries/markdown/injections.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/queries/markdown/injections.scm b/runtime/queries/markdown/injections.scm index e184db157aa6..e88393512f59 100644 --- a/runtime/queries/markdown/injections.scm +++ b/runtime/queries/markdown/injections.scm @@ -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))