mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Fixes #326 - Never escape within body of the <script> tag
This commit is contained in:
parent
bb3d06fd37
commit
641f62edd9
@ -36,6 +36,10 @@ class Text extends Node {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (codegen.context.isFlagSet('SCRIPT_BODY')) {
|
||||||
|
escape = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (escape === true) {
|
if (escape === true) {
|
||||||
argument.value = escapeXml(argument.value.toString());
|
argument.value = escapeXml(argument.value.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
<script><test></script>
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"tags-dir": "./tags"
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
module.exports = function generateCode(elNode, codegen) {
|
||||||
|
var builder = codegen.builder;
|
||||||
|
return builder.htmlElement('script', {}, [
|
||||||
|
builder.text(builder.literal('<test>'))
|
||||||
|
]);
|
||||||
|
};
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"code-generator": "./code-generator"
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<test-script/>
|
||||||
3
test/autotests/render/script-tag-entities-static/test.js
Normal file
3
test/autotests/render/script-tag-entities-static/test.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
exports.templateData = {
|
||||||
|
name: 'John'
|
||||||
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user