Skip to content

Commit 7ac9f6d

Browse files
committed
Fix diff2html errors due to version upgrade #7
+ upgrade diff2html version on lib package too
1 parent 959db04 commit 7ac9f6d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ npm install --save ngx-diff2html
4444

4545
```diff
4646
/* You can add global styles to this file, and also import other style files */
47-
+ @import "~diff2html/dist/diff2html.min.css";
47+
+ @import "~diff2html/bundles/css/diff2html.min.css";
4848
```
4949

5050
**3**. You may also need to add the following lines to `polyfills.ts`:

projects/demo/src/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/* You can add global styles to this file, and also import other style files */
22

3-
@import "~diff2html/dist/diff2html.min.css";
3+
@import "~diff2html/bundles/css/diff2html.min.css";

projects/ngx-diff2html/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"homepage": "https://axel-dev.github.io/ngx-diff2html",
1818
"dependencies": {
1919
"diff-match-patch": "^1.0.4",
20-
"diff2html": "^2.12.2",
20+
"diff2html": "^3.0.0",
2121
"path": "^0.12.7"
2222
},
2323
"peerDependencies": {

projects/ngx-diff2html/src/lib/ngx-diff2html.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from '@angular/core';
22
import { diff_match_patch } from 'diff-match-patch';
3-
import { Diff2Html } from 'diff2html';
3+
import * as Diff2Html from 'diff2html';
44
import { DiffFormat, DiffStyle } from './ngx-diff2html.model';
55

66
@Injectable({
@@ -45,8 +45,8 @@ export class NgxDiff2htmlService {
4545
}
4646

4747
diffToHTML(diff: string, format: DiffFormat = 'line-by-line', style: DiffStyle = 'word') {
48-
return Diff2Html.getPrettyHtml(diff, {
49-
inputFormat: 'diff',
48+
return Diff2Html.html(diff, {
49+
drawFileList: false,
5050
matching: 'lines',
5151
outputFormat: format,
5252
diffStyle: style

0 commit comments

Comments
 (0)