@@ -277,7 +277,7 @@ Assert::same('<!-- </script>-->', $latte->renderToString('context6'));
277277
278278$ latte = new Latte \Engine ;
279279$ latte ->setLoader (new Latte \Loaders \StringLoader ([
280- 'html.latte ' => '<hr> " " < ' ,
280+ 'html.latte ' => '<hr><script></script> " " < ' ,
281281
282282 'context1 ' => '<p>{include html.latte}</p> ' ,
283283 'context1a ' => '<p>{include html.latte|noescape}</p> ' ,
@@ -289,37 +289,40 @@ $latte->setLoader(new Latte\Loaders\StringLoader([
289289 'context2c ' => '<p title="{include html.latte|stripHtml|upper|noescape}"></p> ' ,
290290 'context3 ' => '<p title={include html.latte}></p> ' ,
291291 'context4 ' => '<script>{include html.latte}</script> ' ,
292+ 'context4a ' => '<script type="text/html">{include html.latte}</script> ' ,
292293 'context5 ' => '<style>{include html.latte}</style> ' ,
293294 'context6 ' => '<!--{include html.latte}--> ' ,
294295]));
295296
296- Assert::same ('<p><hr> " " <</p> ' , $ latte ->renderToString ('context1 ' ));
297+ Assert::same ('<p><hr><script></script> " " <</p> ' , $ latte ->renderToString ('context1 ' ));
297298
298- Assert::same ('<p><hr> " " <</p> ' , $ latte ->renderToString ('context1a ' ));
299+ Assert::same ('<p><hr><script></script> " " <</p> ' , $ latte ->renderToString ('context1a ' ));
299300Assert::same ('<p> " " <</p> ' , $ latte ->renderToString ('context1b ' ));
300301Assert::same ('<p> " " <</p> ' , $ latte ->renderToString ('context1c ' ));
301302
302- Assert::same ('<p title="<hr> " " <"></p> ' , $ latte ->renderToString ('context2 ' ));
303+ Assert::same ('<p title="<hr><script></script> " " <"></p> ' , $ latte ->renderToString ('context2 ' ));
303304
304- Assert::same ('<p title="<hr> " " <"></p> ' , $ latte ->renderToString ('context2a ' ));
305+ Assert::same ('<p title="<hr><script></script> " " <"></p> ' , $ latte ->renderToString ('context2a ' ));
305306Assert::same ('<p title=" " " <"></p> ' , $ latte ->renderToString ('context2b ' ));
306307Assert::same ('<p title=" " " <"></p> ' , $ latte ->renderToString ('context2c ' ));
307308
308- Assert::same ('<p title="<hr> " " <"></p> ' , $ latte ->renderToString ('context3 ' ));
309+ Assert::same ('<p title="<hr><script></script> " " <"></p> ' , $ latte ->renderToString ('context3 ' ));
309310
310311Assert::exception (
311312 fn () => $ latte ->renderToString ('context4 ' ),
312313 Latte \RuntimeException::class,
313314 "Including 'html.latte' with content type HTML into incompatible type HTML/RAW+JS. " ,
314315);
315316
317+ Assert::same ('<script type="text/html"><hr><script></script> " " <</script> ' , $ latte ->renderToString ('context4a ' ));
318+
316319Assert::exception (
317320 fn () => $ latte ->renderToString ('context5 ' ),
318321 Latte \RuntimeException::class,
319322 "Including 'html.latte' with content type HTML into incompatible type HTML/RAW+CSS. " ,
320323);
321324
322- Assert::same ('<!--<hr> " " <--> ' , $ latte ->renderToString ('context6 ' ));
325+ Assert::same ('<!--<hr><script></script> " " <--> ' , $ latte ->renderToString ('context6 ' ));
323326
324327
325328
0 commit comments