We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use jsdiff with diff2html to show diff of two strings. Here: https://codepen.io/lwf804/pen/KYOxBL?editors=1001
I don't know why line one is changed. Can you explain for me? Thanks!
The text was updated successfully, but these errors were encountered:
Its because there is a newline character at the end of the stringTwo:
var stringOne = "string 1", stringTwo = `string 1 // <= here there is a \n character that the stringOne doesn't have b`
Sorry, something went wrong.
Correct. This matches the behaviour of the diff Unix util.
diff
(You can preprocess your strings to ensure they always end with a trailing newline if you don't like this behaviour.)
No branches or pull requests
I use jsdiff with diff2html to show diff of two strings.

Here: https://codepen.io/lwf804/pen/KYOxBL?editors=1001
I don't know why line one is changed. Can you explain for me?
Thanks!
The text was updated successfully, but these errors were encountered: