fix: Use parentNode instead of parentElement to fix IE11 crash

fixes #406
This commit is contained in:
Roman Hotsiy 2018-01-21 20:48:49 +02:00
parent 687b75331a
commit e8adb605c3
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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;
}