Do not allow SVG by default (#3640)

This commit is contained in:
Paulus Schoutsen
2019-09-06 17:36:28 -07:00
committed by GitHub
parent 3aba2e3408
commit 2ff4d0fa4b
6 changed files with 36 additions and 14 deletions

View File

@@ -10,6 +10,7 @@ let worker: any | undefined;
@customElement("ha-markdown")
class HaMarkdown extends UpdatingElement {
@property() public content = "";
@property({ type: Boolean }) public allowSvg = false;
protected update(changedProps) {
super.update(changedProps);
@@ -22,11 +23,17 @@ class HaMarkdown extends UpdatingElement {
}
private async _render() {
this.innerHTML = await worker.renderMarkdown(this.content, {
breaks: true,
gfm: true,
tables: true,
});
this.innerHTML = await worker.renderMarkdown(
this.content,
{
breaks: true,
gfm: true,
tables: true,
},
{
allowSvg: this.allowSvg,
}
);
this._resize();