Nested ejs in its own dir to match haml
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent f50d22b · Browse files · 3 files·+54 added−54 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+54 added−54 removed
- other:+54 added−54 removed
Provenance
- Commit
d95f116- Tree
59b05f0- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
f50d22b
3 files changed+54 added−54 removed
modified:lib/express/plugins/view.js+1 added-1 removed
12 unmodified lines1314151617171819202176 unmodified lines12 unmodified lines * Supported template engines. */
var engine = { ejs: require('support/ejs'), ejs: require('support/ejs/ejs'), haml: require('support/haml/haml')}
// --- View76 unmodified linesadded:lib/support/ejs/ejs.js+53 added
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253/* Ejs template parser for CommonJS * * Copyright (c) 2009, Howard Rauscher * Licensed under the MIT License * * base on: * Simple JavaScript Templating (http://ejohn.org/blog/javascript-micro-templating/) * John Resig - http://ejohn.org/ - MIT Licensed */ (function(){ var cache = {}; var ejs = this.ejs = {}; ejs.parse = function tmpl(str, options) { options = options || {}; options.context = options.context || {}; options.locals = options.locals || {}; // Figure out if we're getting a template, or if we need to // load the template - and be sure to cache the result. var fn = cache[str] || // Generate a reusable function that will serve as a template // generator (and which will be cached). new Function("obj", "var p=[];" + // Introduce the data as local variables using with(){} "with(obj){p.push('" + // Convert the template into pure JavaScript str .replace(/\-%>(\n|\r)/g, "%>") .replace(/[\t\b\f]/g, " ") .replace(/[\n\r]/g, "\f") .split("<%").join("\t") .replace(/((^|%>)[^\t]*)'/g, "$1\r") .replace(/\t=(.*?)%>/g, "',$1,'") .split("\t").join("');") .split("%>").join("p.push('") .split("\r").join("\\'").replace(/\f+/g, '\\n') + "');}return p.join('');"); cache[str] = fn; // Provide some basic currying to the user return fn.call(options.context, options.locals); };})(); exports.render = ejs.parse;No newline at end of filedeleted:lib/support/ejs.js-53 removed
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253/* Ejs template parser for CommonJS * * Copyright (c) 2009, Howard Rauscher * Licensed under the MIT License * * base on: * Simple JavaScript Templating (http://ejohn.org/blog/javascript-micro-templating/) * John Resig - http://ejohn.org/ - MIT Licensed */ (function(){ var cache = {}; var ejs = this.ejs = {}; ejs.parse = function tmpl(str, options) { options = options || {}; options.context = options.context || {}; options.locals = options.locals || {}; // Figure out if we're getting a template, or if we need to // load the template - and be sure to cache the result. var fn = cache[str] || // Generate a reusable function that will serve as a template // generator (and which will be cached). new Function("obj", "var p=[];" + // Introduce the data as local variables using with(){} "with(obj){p.push('" + // Convert the template into pure JavaScript str .replace(/\-%>(\n|\r)/g, "%>") .replace(/[\t\b\f]/g, " ") .replace(/[\n\r]/g, "\f") .split("<%").join("\t") .replace(/((^|%>)[^\t]*)'/g, "$1\r") .replace(/\t=(.*?)%>/g, "',$1,'") .split("\t").join("');") .split("%>").join("p.push('") .split("\r").join("\\'").replace(/\f+/g, '\\n') + "');}return p.join('');"); cache[str] = fn; // Provide some basic currying to the user return fn.call(options.context, options.locals); };})(); exports.render = ejs.parse;No newline at end of file