Comparing version 0.5.8 to 0.5.9
var util = require('util'), | ||
fs = require('fs'), | ||
path = require('path'), | ||
Stream = require('stream').Stream, | ||
Stream = require('./mu/stream'), | ||
parser = require('./mu/parser'), | ||
@@ -6,0 +6,0 @@ renderer = require('./mu/renderer'), |
var util = require('util'), | ||
Buffer = require('buffer').Buffer, | ||
carriage = '__MU_CARRIAGE__', | ||
carriageRegExp = new RegExp(carriage, 'g'), | ||
newline = '__MU_NEWLINE__', | ||
@@ -13,3 +15,4 @@ newlineRegExp = new RegExp(newline, 'g'); | ||
function Parser(template, options) { | ||
this.template = template.replace(/\n/g, newline); | ||
this.template = template.replace(/\r\n/g, carriage) | ||
.replace(/\n/g, newline); | ||
this.options = options || {}; | ||
@@ -59,3 +62,5 @@ | ||
var content = this.buffer.substring(0, index).replace(newlineRegExp, '\n'); | ||
var content = this.buffer.substring(0, index) | ||
.replace(carriageRegExp, '\r\n') | ||
.replace(newlineRegExp, '\n'); | ||
buffer = new Buffer(Buffer.byteLength(content)); | ||
@@ -62,0 +67,0 @@ |
@@ -27,3 +27,3 @@ var BUFFER_LENGTH = 1024 * 8; | ||
if (stream.paused) { | ||
stream.on('drain', function () { | ||
stream.on('resumed', function () { | ||
process.nextTick(next); | ||
@@ -30,0 +30,0 @@ }); |
{ "name": "mu2" | ||
, "description": "A Mustache template engine for Node.js" | ||
, "keywords": ["template", "mustache"] | ||
, "version" : "0.5.8" | ||
, "version" : "0.5.9" | ||
, "homepage": "http://github.com/raycmorgan/mu" | ||
@@ -6,0 +6,0 @@ , "author" : "RayMorgan <ray@rumgr.com>" |
@@ -10,2 +10,3 @@ var assert = require('assert'), | ||
'boolean', | ||
'carriage_return', | ||
'comments', | ||
@@ -25,3 +26,3 @@ 'complex', | ||
'two_in_a_row', | ||
'unescaped', | ||
'unescaped' | ||
].forEach(function (name) { | ||
@@ -28,0 +29,0 @@ var js = fs.readFileSync(path.join(mu.root, name + '.js')).toString(), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27882
65
770