mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-09 10:42:02 +00:00
another method of adding an escape tag.
This commit is contained in:
parent
eb4090e257
commit
b19af4deb7
@ -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] === '/';
|
||||
|
Loading…
x
Reference in New Issue
Block a user