Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Fix for inconsistent line feed #604

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/fileprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down