mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-17 06:16:33 +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 = import(/* webpackChunkName: "load_markdown" */ '../resources/load_markdown.js');
|
||||||
}
|
}
|
||||||
loaded.then(
|
loaded.then(
|
||||||
() => { this._scriptLoaded = 1; },
|
({ marked, filterXSS }) => {
|
||||||
|
this.marked = marked;
|
||||||
|
this.filterXSS = filterXSS;
|
||||||
|
this._scriptLoaded = 1;
|
||||||
|
},
|
||||||
() => { this._scriptLoaded = 2; },
|
() => { this._scriptLoaded = 2; },
|
||||||
).then(() => this._render());
|
).then(() => this._render());
|
||||||
}
|
}
|
||||||
@ -41,7 +45,7 @@ class HaMarkdown extends EventsMixin(PolymerElement) {
|
|||||||
this._renderScheduled = false;
|
this._renderScheduled = false;
|
||||||
|
|
||||||
if (this._scriptLoaded === 1) {
|
if (this._scriptLoaded === 1) {
|
||||||
this.innerHTML = window.filterXSS(window.marked(this.content, {
|
this.innerHTML = this.filterXSS(this.marked(this.content, {
|
||||||
gfm: true,
|
gfm: true,
|
||||||
tables: true,
|
tables: true,
|
||||||
breaks: true
|
breaks: true
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import marked from 'marked';
|
import marked_ from 'marked';
|
||||||
import filterXSS from 'xss';
|
import filterXSS_ from 'xss';
|
||||||
|
|
||||||
window.marked = marked;
|
export const marked = marked_;
|
||||||
window.filterXSS = filterXSS;
|
export const filterXSS = filterXSS_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user