Skip to content

Commit

Permalink
Merge pull request #329 from rtfpessoa/fix-escaping-long-lines
Browse files Browse the repository at this point in the history
fix: Enforce escape for lines that are not highlighted
  • Loading branch information
rtfpessoa authored Jul 26, 2020
2 parents c7c56bc + a61c7cf commit 4162188
Show file tree
Hide file tree
Showing 3 changed files with 311 additions and 2 deletions.
283 changes: 283 additions & 0 deletions src/__tests__/diff2html-tests.ts

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions src/__tests__/diffs/bad-escaping.diff

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/render-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ export function diffHighlight(
return {
oldLine: {
prefix: line1.prefix,
content: line1.content,
content: escapeForHtml(line1.content),
},
newLine: {
prefix: line2.prefix,
content: line2.content,
content: escapeForHtml(line2.content),
},
};
}
Expand Down

0 comments on commit 4162188

Please sign in to comment.