diff --git a/lib/widget.js b/lib/widget.js index f1198ef..086b916 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -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] === '/';