mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
parse string content as raw string
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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="\r\r">', BR({x:'\n\n'}));
|
||||
succeed('<br x=y\r>', BR({x:'y'}));
|
||||
fatal('<br x=\r>');
|
||||
succeed('<script>var x="<div>";</script>',SCRIPT('var x="<div>";'));
|
||||
succeed('<script>var x=1 && 0;</script>',SCRIPT('var x=1 && 0;'));
|
||||
});
|
||||
|
||||
Tinytest.add("html-tools - parseFragment", function (test) {
|
||||
@@ -365,5 +368,4 @@ Tinytest.add("html-tools - getTemplateTag", function (test) {
|
||||
succeed('<textarea {{a}} x=1 {{b}}></textarea>',
|
||||
TEXTAREA(Attrs({x:"1"}, TemplateTag({stuff: 'a'}),
|
||||
TemplateTag({stuff: 'b'}))));
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user