mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 21:36:36 +00:00
Remove marked from window (#1195)
This commit is contained in:
parent
1eda9155fd
commit
1d144a101c
@ -26,7 +26,11 @@ class HaMarkdown extends EventsMixin(PolymerElement) {
|
||||
loaded = import(/* webpackChunkName: "load_markdown" */ '../resources/load_markdown.js');
|
||||
}
|
||||
loaded.then(
|
||||
() => { this._scriptLoaded = 1; },
|
||||
({ marked, filterXSS }) => {
|
||||
this.marked = marked;
|
||||
this.filterXSS = filterXSS;
|
||||
this._scriptLoaded = 1;
|
||||
},
|
||||
() => { this._scriptLoaded = 2; },
|
||||
).then(() => this._render());
|
||||
}
|
||||
@ -41,7 +45,7 @@ class HaMarkdown extends EventsMixin(PolymerElement) {
|
||||
this._renderScheduled = false;
|
||||
|
||||
if (this._scriptLoaded === 1) {
|
||||
this.innerHTML = window.filterXSS(window.marked(this.content, {
|
||||
this.innerHTML = this.filterXSS(this.marked(this.content, {
|
||||
gfm: true,
|
||||
tables: true,
|
||||
breaks: true
|
||||
|
@ -1,5 +1,5 @@
|
||||
import marked from 'marked';
|
||||
import filterXSS from 'xss';
|
||||
import marked_ from 'marked';
|
||||
import filterXSS_ from 'xss';
|
||||
|
||||
window.marked = marked;
|
||||
window.filterXSS = filterXSS;
|
||||
export const marked = marked_;
|
||||
export const filterXSS = filterXSS_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user