We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
style
1 parent bdd081a commit 7c71903Copy full SHA for 7c71903
src/svg/core.ts
@@ -70,9 +70,9 @@ export function vNodeToString(el: SVGVNode, opts?: {
70
opts = opts || {};
71
const S = opts.newline ? '\n' : '';
72
function convertElToString(el: SVGVNode): string {
73
- const {children, tag, attrs} = el;
+ const {children, tag, attrs, text} = el;
74
return createElementOpen(tag, attrs)
75
- + encodeHTML(el.text)
+ + (tag !== 'style' ? encodeHTML(text) : text || '')
76
+ (children ? `${S}${map(children, child => convertElToString(child)).join(S)}${S}` : '')
77
+ createElementClose(tag);
78
}
0 commit comments