Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function diff_strings(string_0, string_1) {
let output_lines = [];
let ndiff_output = "";
let changes_list = [];
ndiff_output = difflib.ndiff(string_0.split("\n"), string_1.split("\n"));
ndiff_output.forEach((line) => {
if (line.startsWith("+")) {
output_lines.push(line);
} else if (line.startsWith("-")) {
output_lines.push(line);
} else if (line.startsWith("?")) {
changes_list = parse_questionmark_line(line);
output_lines[output_lines.length - 1] = apply_color(
output_lines[output_lines.length - 1], changes_list);
} else {
output_lines.push(line);
}
});
const emphasize_codes = (string) => {