diff --git a/lib/fileprocessor.js b/lib/fileprocessor.js index de4d8d4..d27743d 100644 --- a/lib/fileprocessor.js +++ b/lib/fileprocessor.js @@ -151,9 +151,8 @@ var FileProcessor = module.exports = function (type, patterns, finder, logcb, bl // FileProcessor.prototype.replaceBlocks = function replaceBlocks(file) { var result = file.content; - var linefeed = /\r\n/g.test(result) ? '\r\n' : '\n'; file.blocks.forEach(function (block) { - var blockLine = block.raw.join(linefeed); + var blockLine = result.substring(result.indexOf(block.raw[0]), result.indexOf(block.raw[block.raw.length - 1]) + block.raw[block.raw.length - 1].length); result = result.replace(blockLine, this.replaceWith(block)); }, this); return result;