diff --git a/src/transpiling/jsx_precompile.rs b/src/transpiling/jsx_precompile.rs index 1966176..19dad60 100644 --- a/src/transpiling/jsx_precompile.rs +++ b/src/transpiling/jsx_precompile.rs @@ -543,7 +543,7 @@ fn merge_serializable_children( } // Can be flattened Lit::Str(str_lit) => { - buf.push_str(str_lit.value.as_ref()); + buf.push_str(&escape_html(str_lit.value.as_ref())); continue; } _ => {} @@ -2051,6 +2051,16 @@ const $$_tpl_1 = [ ]; const a = _jsxTemplate($$_tpl_1, _jsxEscape(foo), _jsxEscape(bar));"#, ); + + test_transform( + JsxPrecompile::default(), + r#"const a =
{"\"a&>'"}
;"#, + r#"import { jsxTemplate as _jsxTemplate } from "react/jsx-runtime"; +const $$_tpl_1 = [ + "
"a&>'
" +]; +const a = _jsxTemplate($$_tpl_1);"#, + ); } #[test]