Improve integration with `react-diff-view` and investigate if `unidiff` can be entirely obsoleted and deprecated. (Originally: "Is there a way to remove the `======` separator that appears at the top of diffs?")
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- tooling
Research direction
Start at src/patch/create.ts around line 266 and reproduce the diff output consumed by react-diff-view. Compare the generated output with the git diff and unidiff formats described in the issue and determine whether the separator can be avoided; done means react-diff-view no longer requires caller-side stripping and the status of unidiff deprecation is documented.
Written by the indexing model from the issue text.
Description
I'm using jsdiff with react-diff-view and am finding myself having to remove the =================================================================== line that appears at the top of the output diff, like so:
if (lines.length > 0 && lines[0].startsWith("======")) {
// Find the first --- line and start from there
const headerStart = lines.findIndex((line) => line.startsWith("---"));
if (headerStart >= 0) {
return lines.slice(headerStart).join("\n");
}
}
The reason appears to be the same as is described in this issue, in that react-diff-view expects diffs to be in either git diff or unidiff format.
Can you please help me understand why it gets included in jsdiff output, and whether there's a way to prevent it? I'd love to avoid having to strip it myself.
Thanks!
- Dominant language
- JavaScript
- Stars
- 9.2k
- Forks
- 555
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kpdecker/jsdiff
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
kpdecker/jsdiff#703 · 1 reaction ·
Maintainers usually reply within 1 day
-
Applying a patch with a fuzzFactor can be very very slowPossibly taken @json-open-source claimed this 39 days ago. Openperformance
Difficulty 4/5 3-5 days Newbie friendliness 48/100
kpdecker/jsdiff#692 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
kpdecker/jsdiff#684 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
kpdecker/jsdiff#629 · 7 comments ·
Maintainers usually reply within 1 day
Similar issues
-
channels:edit check:passed
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
lidofinance/docs#1033 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day