Fixes #84 - Allow XML escaping for tag to be disabled as part of tag def

This commit is contained in:
Patrick Steele-Idem 2015-06-04 16:06:27 -06:00
parent 3845da31a1
commit 0e34a7a570
6 changed files with 16 additions and 1 deletions

View File

@ -364,6 +364,11 @@ TagHandlers.prototype = {
nestedTag.name = nestedTagName;
tag.addNestedTag(nestedTag);
});
},
escapeXmlBody: function(value) {
if (value === false) {
this.tag.escapeXmlBody = false;
}
}
};

View File

@ -273,6 +273,10 @@ module.exports = function transform(node, compiler, template) {
node.setPreserveWhitespace(true);
}
if (tag.escapeXmlBody === false) {
node.setEscapeXmlBodyText(false);
}
if (tag.renderer || tag.isNestedTag) {
shouldRemoveAttr = false;

View File

@ -24,7 +24,8 @@
"transformer": "./html-tag-transformer"
},
"html-comment": {
"renderer": "./CommentTag"
"renderer": "./CommentTag",
"escape-xml-body": false
}
}
}

View File

@ -0,0 +1 @@
<!--[if lt IE 9]><div><![endif]-->

View File

@ -0,0 +1 @@
<html-comment><![CDATA[[if lt IE 9]><div><![endif]]]></html-comment>

View File

@ -0,0 +1,3 @@
exports.templateData = {
"name": "World"
};