Lines Matching +refs:text +refs:line +refs:d
346 var context = lines.slice(start, end).map(function (line, i){ argument
351 + line;
415 exports.render = function (template, d, o) { argument
416 var data = d || utils.createNullProtoObjWherePossible();
509 function Template(text, opts) { argument
512 this.templateText = text;
697 var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
699 d = utils.shallowCopy(d, includeData);
701 return includeFile(path, opts)(d);
737 var d = this.opts.delimiter;
742 matches.forEach(function (line, index) { argument
748 if ( line.indexOf(o + d) === 0 // If it is a tag
749 && line.indexOf(o + d + d) !== 0) { // and is not escaped
751 if (!(closing == d + c || closing == '-' + d + c || closing == '_' + d + c)) {
752 throw new Error('Could not find matching close tag for "' + line + '".');
755 self.scanLine(line);
788 _addOutput: function (line) { argument
795 line = line.replace(/^(?:\r\n|\r|\n)/, '');
798 if (!line) {
799 return line;
803 line = line.replace(/\\/g, '\\\\');
806 line = line.replace(/\n/g, '\\n');
807 line = line.replace(/\r/g, '\\r');
811 line = line.replace(/"/g, '\\"');
812 this.source += ' ; __append("' + line + '")' + '\n';
815 scanLine: function (line) { argument
817 var d = this.opts.delimiter;
822 newLineCount = (line.split('\n').length - 1);
824 switch (line) {
825 case o + d:
826 case o + d + '_':
829 case o + d + '=':
832 case o + d + '-':
835 case o + d + '#':
838 case o + d + d:
840 this.source += ' ; __append("' + line.replace(o + d + d, o + d) + '")' + '\n';
842 case d + d + c:
844 this.source += ' ; __append("' + line.replace(d + d + c, d + c) + '")' + '\n';
846 case d + c:
847 case '-' + d + c:
848 case '_' + d + c:
850 this._addOutput(line);
854 this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0;
864 if (line.lastIndexOf('//') > line.lastIndexOf('\n')) {
865 line += '\n';
871 this.source += ' ; ' + line + '\n';
875 this.source += ' ; __append(escapeFn(' + stripSemi(line) + '))' + '\n';
879 this.source += ' ; __append(' + stripSemi(line) + ')' + '\n';
886 this._addOutput(line);
892 this._addOutput(line);