diff --git a/packages/html-tools/parse.js b/packages/html-tools/parse.js
index cf4602cb34..4a830dc54c 100644
--- a/packages/html-tools/parse.js
+++ b/packages/html-tools/parse.js
@@ -170,6 +170,8 @@ getContent = HTMLTools.Parse.getContent = function (scanner, shouldStopFunc) {
attrs.value = textareaValue;
}
}
+ } else if (token.n === 'script') {
+ content = getRawText(scanner, token.n, shouldStopFunc);
} else {
content = getContent(scanner, shouldStopFunc);
}
diff --git a/packages/html-tools/parse_tests.js b/packages/html-tools/parse_tests.js
index 6bac32fd5b..987f123353 100644
--- a/packages/html-tools/parse_tests.js
+++ b/packages/html-tools/parse_tests.js
@@ -13,6 +13,7 @@ var A = HTML.A;
var DIV = HTML.DIV;
var P = HTML.P;
var TEXTAREA = HTML.TEXTAREA;
+var SCRIPT = HTML.SCRIPT;
Tinytest.add("html-tools - parser getContent", function (test) {
@@ -149,6 +150,8 @@ Tinytest.add("html-tools - parser getContent", function (test) {
succeed('
', BR({x:'\n\n'}));
succeed('
', BR({x:'y'}));
fatal('
');
+ succeed('',SCRIPT('var x="