another method of adding an escape tag.

This commit is contained in:
Christopher Jeffrey 2014-04-26 06:47:41 -05:00
parent eb4090e257
commit b19af4deb7

View File

@ -2025,9 +2025,29 @@ Element.prototype._parseTags = function(text) {
, cap
, slash
, param
, attr;
, attr
, esc;
for (;;) {
if (!esc && (cap = /^{escape}/.exec(text))) {
text = text.substring(cap[0].length);
esc = true;
continue;
}
if (esc && (cap = /^([\s\S]+?){\/escape}/.exec(text))) {
text = text.substring(cap[0].length);
out += cap[1];
esc = false;
continue;
}
if (esc) {
// throw new Error('Unterminated escape tag.');
out += text;
break;
}
if (cap = /^{(\/?)([\w\-,;!#]*)}/.exec(text)) {
text = text.substring(cap[0].length);
slash = cap[1] === '/';