var types = this.types; var data = child.data; switch(child.nodeType){ case 1: this._tokenize(child, tokens); return; case 3: if(data.match(/[^\s\n]/|>) && (data.indexOf("{{") != -1 || data.indexOf("{%") != -1)){ var texts = ddt.tokenize(data); for(var j = 0, text; text = texts[j]; j++){ if(typeof text == "string"){ tokens.push([types.text, text]); }else{ tokens.push(text); } } }else{ tokens.push([child.nodeType, child]); } if(child.parentNode) child.parentNode.removeChild(child); return; case 8: if(data.indexOf("{%") == 0){ var text = dojo.trim(data.slice(2, -2)); if(text.substr(0, 5) == "load "){ var parts = dd.text.pySplit(dojo.trim(text)); for(var i = 1, part; part = parts[i]; i++){ dojo["require"](part); } } tokens.push([types.tag, text]); } if(data.indexOf("{{") == 0){ tokens.push([types.varr, dojo.trim(data.slice(2, -2))]); } if(child.parentNode) child.parentNode.removeChild(child); return; }