You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add (failing) test case from #531
* Fix test I just added (the test itself, not the jsdiff behaviour)
* Fix the new test (but make an old one fail as a side effect)
* Stop allowing newlineIsToken to be passed to patch-generation functions (... and causing them to generate patches that can't be applied)
* Remove impossible case to placate the coverage checker
* Add release notes
Copy file name to clipboardExpand all lines: README.md
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,6 @@ Broadly, jsdiff's diff functions all take an old text and a new text and perform
91
91
-`context` describes how many lines of context should be included. You can set this to `Number.MAX_SAFE_INTEGER` or `Infinity` to include the entire file content in one hunk.
92
92
-`ignoreWhitespace`: Same as in `diffLines`. Defaults to `false`.
93
93
-`stripTrailingCr`: Same as in `diffLines`. Defaults to `false`.
94
-
-`newlineIsToken`: Same as in `diffLines`. Defaults to `false`.
Copy file name to clipboardExpand all lines: release-notes.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@
32
32
* The `fuzzFactor` now indicates the maximum [*Levenshtein* distance](https://en.wikipedia.org/wiki/Levenshtein_distance) that there can be between the context shown in a hunk and the actual file content at a location where we try to apply the hunk. (Previously, it represented a maximum [*Hamming* distance](https://en.wikipedia.org/wiki/Hamming_distance), meaning that a single insertion or deletion in the source file could stop a hunk from applying even with a high `fuzzFactor`.)
33
33
* A hunk containing a deletion can now only be applied in a context where the line to be deleted actually appears verbatim. (Previously, as long as enough context lines in the hunk matched, `applyPatch` would apply the hunk anyway and delete a completely different line.)
34
34
* The context line immediately before and immediately after an insertion must match exactly between the hunk and the file for a hunk to apply. (Previously this was not required.)
35
+
-[#535](https://github.com/kpdecker/jsdiff/pull/535)**A bug in patch generation functions is now fixed** that would sometimes previously cause `\ No newline at end of file` to appear in the wrong place in the generated patch, resulting in the patch being invalid.
36
+
-[#535](https://github.com/kpdecker/jsdiff/pull/535)**Passing `newlineIsToken: true` to *patch*-generation functions is no longer allowed.** (Passing it to `diffLines` is still supported - it's only functions like `createPatch` where passing `newlineIsToken` is now an error.) Allowing it to be passed never really made sense, since in cases where the option had any effect on the output at all, the effect tended to be causing a garbled patch to be created that couldn't actually be applied to the source file.
0 commit comments