add cdata-like tag.

This commit is contained in:
Christopher Jeffrey 2014-04-26 06:20:26 -05:00
parent 4bc910bd5b
commit bef9c09598
1 changed files with 23 additions and 1 deletions

View File

@ -2025,7 +2025,9 @@ Element.prototype._parseTags = function(text) {
, cap
, slash
, param
, attr;
, attr
, esc
, buf;
for (;;) {
if (cap = /^{(\/?)([\w\-,;!#]*)}/.exec(text)) {
@ -2033,6 +2035,22 @@ Element.prototype._parseTags = function(text) {
slash = cap[1] === '/';
param = cap[2].replace(/-/g, ' ');
if (!slash && param === 'escape') {
buf = '';
esc = true;
continue;
} else if (slash && param === 'escape') {
out += buf;
buf = '';
esc = false;
continue;
}
if (esc) {
buf += cap[0];
continue;
}
if (param === 'open') {
out += '{';
continue;
@ -2086,6 +2104,10 @@ Element.prototype._parseTags = function(text) {
if (cap = /^[\s\S]+?(?={\/?[\w\-,;!#]*})/.exec(text)) {
text = text.substring(cap[0].length);
if (esc) {
buf += cap[0];
continue;
}
out += cap[0];
continue;
}