Closed Lordfirespeed closed 1 year ago
{ drawFileList: true, matching: "lines", outputFormat: "line-by-line", }
Blank context lines are being ignored by the diff parser
lines
export default function create_app() { const app = express(); app.set("view engine", "ejs"); app.get("/", async (request, response) => { const diff = await readFile("diffs/diff2htmldemo.diff", "utf-8"); const parsed_diff = diff2html.parse(diff); const formatted_diff = diff2html.html(parsed_diff, { drawFileList: true, matching: "lines", outputFormat: "line-by-line", }); response.render("pages/diff", { diff_tables: formatted_diff }) }); app.use("/", express.static("static")); app.use("/diff2html-bundles", express.static("node_modules/diff2html/bundles")); return app; }
My IDE was removing the important leading whitespace at the beginning of blank context lines. Duh.
Step 0: Describe your environment
Step 1: Describe the problem:
Blank context lines are being ignored by the diff parser
Steps to reproduce:
Observed Results:
lines
array, it only has length 7 and line numbers are incorrect (although contiguous)Expected Results:
lines
arrayRelevant Code: