Skip to content

Commit 5e8b247

Browse files
committed
fix: Maximum call stack size exceeded for large diffs
1 parent 1350740 commit 5e8b247

File tree

3 files changed

+140030
-4
lines changed

3 files changed

+140030
-4
lines changed

src/__tests__/diff2html-tests.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,11 @@ describe('Diff2Html', () => {
974974
`);
975975
});
976976

977+
it('Should works with large diff blocks', () => {
978+
const diff = fs.readFileSync('src/__tests__/diffs/large.diff', 'utf-8');
979+
expect(() => html(diff)).not.toThrow();
980+
});
981+
977982
it('should escape html correctly', () => {
978983
const diff = fs.readFileSync('src/__tests__/diffs/bad-escaping.diff', 'utf-8');
979984

0 commit comments

Comments
 (0)