diff --git a/Tokenizer.js b/Tokenizer.js index bcf3209..2f2fc0a 100755 --- a/Tokenizer.js +++ b/Tokenizer.js @@ -406,158 +406,183 @@ Tokenizer.prototype = { } } returnValue.twinfo = twinfo; - } else if (regex && part[9]) { // this.tagLiterals - var processValue = function(val){ - // post process dynamic parts of this value - // anything wrapped in (unescaped) { and } is considered to be - // a literal js expression. so we should parse an expression here - // and that's where the voodoo inception starts. we must now - // invoke a new instance of ZeParser, make it read an - // expression and ensure the next char is the closing curly. - // only then is it deemed valid. - - // ... - // too difficult for now. let's just go with "escape all teh curlies!" - - var arrtxtjs = []; // uneven array. uneven elements are text, even elements are js - - var last = 0; - for (var i=0; i 1) { // if we did find any dynamic js block... - for (var i=0; i + + // tree, unary, content, multiline: + // hello + // + + // attributes, default true attributes, single and double quotes: + // + + // dynamic content (content normally parsed as js in a sub-parser): + //
{["hello","world"].join(' ')}
+ + // escaping content with single backslash + //
hah\<\ + + // note: tag content is escaped (one slash removed), js content is not + // currently not really possible to use } or > in js code unless you + // can somehow prefix them with a backslash (strings, regex) + // if you must have these otherwise the fallback is eval + + var processValue = function(val){ + // post process dynamic parts of this value + // anything wrapped in (unescaped) { and } is considered to be + // a literal js expression. so we should parse an expression here + // and that's where the voodoo inception starts. we must now + // invoke a new instance of ZeParser, make it read an + // expression and ensure the next char is the closing curly. + // only then is it deemed valid. + + // ... + // too difficult for now. let's just go with "escape all teh curlies!" + + var arrtxtjs = []; // uneven array. uneven elements are text, even elements are js + + var last = 0; + for (var i=0; i 1) { // if we did find any dynamic js block... + console.log(["has",arrtxtjs.length,"items",arrtxtjs]) + for (var i=1; i