Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove unused codes during compiling

  • Loading branch information...
commit 99d3f846cc52dc5442c15d8b4672a81a91c6b198 1 parent 2292715
Shaun authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/jst.js
4 lib/jst.js
View
@@ -30,11 +30,11 @@ var compile = exports.compile = function(ctx) {
var code = (_options.useIt ? 'var out = "' : 'var out = ""; with(it) { out += "')
+ ctx.replace(/[\t\r\n]/g, '')
.replace(/"/g, '\\"').replace(/\{#.+?#\}/g, '')
- .replace(/\{\{ (.*?) \}\}/g, '"; out += $1; out +="')
+ .replace(/\{\{ (.*?) \}\}/g, '"; out += $1; out += "')
.split('\{% ').join('"; ')
.split(' %\}').join(' out +="')
+ (_options.useIt ? '"; return out;' : '"; } return out;');
- return new Function('it', code);
+ return new Function('it', code.replace(' out += "";', ''));
}
var render = exports.render = function(ctx, args) {
Please sign in to comment.
Something went wrong with that request. Please try again.