Disable XSS filter in flow step desc markdown (#1599)

This commit is contained in:
Jason Hu 2018-08-26 03:44:50 -07:00 committed by Paulus Schoutsen
parent f64ddf46e2
commit c8ea4cd85e
3 changed files with 8 additions and 4 deletions

View File

@ -12,7 +12,11 @@ class HaMarkdown extends EventsMixin(PolymerElement) {
content: {
type: String,
observer: '_render',
}
},
disableXssFilter: {
type: Boolean,
value: false,
},
};
}
@ -29,7 +33,7 @@ class HaMarkdown extends EventsMixin(PolymerElement) {
loaded.then(
({ marked, filterXSS }) => {
this.marked = marked;
this.filterXSS = filterXSS;
this.filterXSS = this.disableXssFilter ? c => c : filterXSS;
this._scriptLoaded = 1;
},
() => { this._scriptLoaded = 2; },

View File

@ -71,7 +71,7 @@ class HaConfigFlow extends
<template is="dom-if" if="[[_equals(_step.type, 'form')]]">
<template is="dom-if" if="[[_computeStepDescription(localize, _step)]]">
<ha-markdown content="[[_computeStepDescription(localize, _step)]]"></ha-markdown>
<ha-markdown content="[[_computeStepDescription(localize, _step)]]" disable-xss-filter></ha-markdown>
</template>
<ha-form

View File

@ -71,7 +71,7 @@ class HaMfaModuleSetupFlow extends
<template is="dom-if" if="[[_equals(_step.type, 'form')]]">
<template is="dom-if" if="[[_computeStepDescription(localize, _step)]]">
<ha-markdown content="[[_computeStepDescription(localize, _step)]]"></ha-markdown>
<ha-markdown content="[[_computeStepDescription(localize, _step)]]" disable-xss-filter></ha-markdown>
</template>
<ha-form