crlf
crlf copied to clipboard
mixed lines endings in document
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?
Same issue here
Unfortunately I don't really have time to work on this. I'm happy to accept a PR that fixes this
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.