From d27a2bdd1dab529f0bfa555359b19dc1431ae57a Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 17 Sep 2025 14:21:01 -0700 Subject: [PATCH] Fix raw status ending in the HTML tokenizer This fixes a small mistake where the "raw" status wasn't being reset once exiting the script or style tags. That means any text nodes that followed would be misinterpreted as being raw. --- crates/mdbook-html/src/html/tree.rs | 1 + .../rendering/html_blocks/expected/script-in-block.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/mdbook-html/src/html/tree.rs b/crates/mdbook-html/src/html/tree.rs index 802a215e..1b5ab0b9 100644 --- a/crates/mdbook-html/src/html/tree.rs +++ b/crates/mdbook-html/src/html/tree.rs @@ -614,6 +614,7 @@ where } } TagKind::EndTag => { + is_raw = false; if self.is_html_tag_matching(&tag.name) { self.pop(); } diff --git a/tests/testsuite/rendering/html_blocks/expected/script-in-block.html b/tests/testsuite/rendering/html_blocks/expected/script-in-block.html index 2b96ac5f..a37ad44e 100644 --- a/tests/testsuite/rendering/html_blocks/expected/script-in-block.html +++ b/tests/testsuite/rendering/html_blocks/expected/script-in-block.html @@ -3,5 +3,5 @@ - < still in block + < still in block \ No newline at end of file