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.
commit7905086b55eac2a817c16fe3a9ab987e718324c8
authorMichael Davis <mcarsondavis@gmail.com>
dateThu 22 Dec 2022, 19:21 (4 years ago)
parentc4263d6
runtime/queries/markdown/injections.scm+4−1
@@ -5,7 +5,10 @@
55 (language) @injection.language)
66 (code_fence_content) @injection.content (#set! injection.include-unnamed-children))
77
8−((html_block) @injection.content (#set! injection.language "html") (#set! injection.include-unnamed-children))
8+((html_block) @injection.content
9+ (#set! injection.language "html")
10+ (#set! injection.include-unnamed-children)
11+ (#set! injection.combined))
912
1013((pipe_table_cell) @injection.content (#set! injection.language "markdown.inline") (#set! injection.include-unnamed-children))
1114