File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { iconStyles } from './icon-styles.js';
55import { loadSvg } from '../../generated/icons/presetIconLoader.js' ;
66import { RtlMixin } from '../../mixins/rtl-mixin.js' ;
77import { runAsync } from '../../directives/run-async.js' ;
8- import { unsafeHTML } from 'lit-html/directives/unsafe-html .js' ;
8+ import { unsafeSVG } from 'lit-html/directives/unsafe-svg .js' ;
99
1010class Icon extends RtlMixin ( LitElement ) {
1111
@@ -47,13 +47,13 @@ class Icon extends RtlMixin(LitElement) {
4747 return undefined ;
4848 }
4949
50- const elem = document . createElement ( 'div ' ) ;
51- elem . innerHTML = svgStr ;
50+ const template = document . createElement ( 'template ' ) ;
51+ template . innerHTML = svgStr ;
5252
53- const svg = elem . firstChild ;
53+ const svg = template . content . firstChild ;
5454 fixSvg ( svg ) ;
5555
56- return html `${ unsafeHTML ( elem . innerHTML ) } ` ;
56+ return html `${ unsafeSVG ( template . innerHTML ) } ` ;
5757
5858 }
5959
You can’t perform that action at this time.
0 commit comments