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!