diff --git a/src/Latte/Compiler/Compiler.php b/src/Latte/Compiler/Compiler.php index 0df0d690b..50828724f 100644 --- a/src/Latte/Compiler/Compiler.php +++ b/src/Latte/Compiler/Compiler.php @@ -533,7 +533,7 @@ private function processHtmlTagEnd(Token $token): void } elseif ( (($lower = strtolower($htmlNode->name)) === 'script' || $lower === 'style') - && (!isset($htmlNode->attrs['type']) || preg_match('#(java|j|ecma|live)script|module|json|css#i', $htmlNode->attrs['type'])) + && (!isset($htmlNode->attrs['type']) || preg_match('#(java|j|ecma|live)script|module|json|css|plain#i', $htmlNode->attrs['type'])) ) { $this->context = $lower === 'script' ? self::CONTEXT_HTML_JS diff --git a/tests/common/contentType.html.javascript.phpt b/tests/common/contentType.html.javascript.phpt index 45a98a452..30c518808 100644 --- a/tests/common/contentType.html.javascript.phpt +++ b/tests/common/contentType.html.javascript.phpt @@ -67,6 +67,11 @@ Assert::match( $latte->renderToString('