crlf icon indicating copy to clipboard operation
crlf copied to clipboard

mixed lines endings in document

Open gladziu90 opened this issue 8 years ago • 3 comments

Hi, I have a document with mixed lines endings e.g. lf crlf lf generated by webpack btw. I want to replace it into lf. In such case crls detects the first line with lf as line endings in whole document and skips replacing. Is it possible to add e.g force flag to traverse document even if the first line indicates compatible line endings? or add some additional condition during checking?

gladziu90 avatar Oct 30 '17 06:10 gladziu90

Same issue here

yavorski avatar Apr 19 '18 11:04 yavorski

Unfortunately I don't really have time to work on this. I'm happy to accept a PR that fixes this

kolodny avatar May 01 '18 18:05 kolodny

A quick win, is to remove this if statement.

if (currentEndingType === endingType) {

      // early success
      return callback(null, currentEndingType);
    }

This is what I have done locally.

What I plan to do is write a pull request that will test if endingType is of type object.
This will allow us to pass in both endingType and force which will allow the 'quick win' and the change it anyway regardless of if it matches or not.

WORMSS avatar Feb 06 '19 10:02 WORMSS