Skip to content

Commit

Permalink
fix: Use parentNode instead of parentElement to fix IE11 crash
Browse files Browse the repository at this point in the history
fixes #406
  • Loading branch information
RomanHotsiy committed Jan 21, 2018
1 parent 687b753 commit e8adb60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/components/Redoc/redoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Redoc extends BaseComponent implements OnInit {
optionsMgr.options = getPreOptions();

this.element = elementRef.nativeElement;
this.$parent = this.element.parentElement;
this.$parent = this.element.parentNode as Element;
this.$refElem = this.element.nextElementSibling;

//parse options (top level component doesn't support inputs)
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/md-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import * as Remarkable from 'remarkable';
import { StringMap } from './';

function HTMLescape(html: string): string {
return document.createElement('div')
return (document.createElement('div')
.appendChild(document.createTextNode(html))
.parentElement
.parentNode as Element)
.innerHTML;
}

Expand Down

0 comments on commit e8adb60

Please sign in to comment.