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';
5
5
import { loadSvg } from '../../generated/icons/presetIconLoader.js' ;
6
6
import { RtlMixin } from '../../mixins/rtl-mixin.js' ;
7
7
import { 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' ;
9
9
10
10
class Icon extends RtlMixin ( LitElement ) {
11
11
@@ -47,13 +47,13 @@ class Icon extends RtlMixin(LitElement) {
47
47
return undefined ;
48
48
}
49
49
50
- const elem = document . createElement ( 'div ' ) ;
51
- elem . innerHTML = svgStr ;
50
+ const template = document . createElement ( 'template ' ) ;
51
+ template . innerHTML = svgStr ;
52
52
53
- const svg = elem . firstChild ;
53
+ const svg = template . content . firstChild ;
54
54
fixSvg ( svg ) ;
55
55
56
- return html `${ unsafeHTML ( elem . innerHTML ) } ` ;
56
+ return html `${ unsafeSVG ( template . innerHTML ) } ` ;
57
57
58
58
}
59
59
You can’t perform that action at this time.
0 commit comments