Skip to content

Commit 56818ba

Browse files
committed
Remove global style from library component
+ Fix white space in filename input
1 parent 0c9c140 commit 56818ba

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

projects/ngx-diff2html/src/lib/ngx-diff2html.component.css

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, Input, OnChanges, SimpleChanges, SimpleChange, ViewEncapsulation, Output, EventEmitter } from '@angular/core';
1+
import { Component, OnInit, Input, OnChanges, SimpleChanges, SimpleChange, Output, EventEmitter } from '@angular/core';
22
import { NgxDiff2htmlService } from './ngx-diff2html.service';
33
import { DiffFormat, DiffStyle } from './ngx-diff2html.model';
44

@@ -7,14 +7,13 @@ import { DiffFormat, DiffStyle } from './ngx-diff2html.model';
77
template: `
88
<div [innerHtml]="diffHTML"></div>
99
`,
10-
styleUrls: ['./ngx-diff2html.component.css'],
11-
encapsulation: ViewEncapsulation.None
10+
styles: []
1211
})
1312
export class NgxDiff2htmlComponent implements OnInit, OnChanges {
1413

1514
@Input() private left: string;
1615
@Input() private right: string;
17-
@Input() private filename: string = ' '; // cannot be null or empty
16+
@Input() private filename: string = '';
1817
@Input() private format: DiffFormat = 'line-by-line';
1918
@Input() private style: DiffStyle = 'word';
2019
@Output() diffChange: EventEmitter<string> = new EventEmitter();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class NgxDiff2htmlService {
3636
const unifiedDiff = lines.join("\n");
3737
// console.info(unifiedDiff);
3838

39-
const strInput = "--- " + filename + "\n+++ " + filename + "\n" + unifiedDiff;
39+
const strInput = "--- " + filename + " \n+++ " + filename + " \n" + unifiedDiff;
4040
const diff = decodeURIComponent(strInput);
4141
// console.info(diff);
4242

0 commit comments

Comments
 (0)