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.
2 parents 04e2693 + 7c71903 commit 9197e05Copy full SHA for 9197e05
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