Skip to content

oBusk/jsdiff-crlf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jsdiff CRLF vs LF

This is a example to show that there is no good way to diff files with different file endings with jsdiff.

If you clone this repo on windows (with git autocrlf) you will probably not be able to reproduce the examples below.

On unix Run

file -k crlf.txt lf.txt

And make sure you see

crlf.txt: ASCII text, with CRLF line terminators
lf.txt:   ASCII text

GNU diff

Using the --strip-trailing-cr option.

diff --strip-trailing-cr lf.txt crlf.txt
# Returns nothing

git diff

Using the --ignore-cr-at-eol option.

git diff --no-index --ignore-cr-at-eol crlf.txt lf.txt
# Returns nothing

JSDiff

npm test
# node index.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published