aboutsummaryrefslogtreecommitdiff
path: root/web_src/js/svg.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/svg.js')
-rw-r--r--web_src/js/svg.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/web_src/js/svg.js b/web_src/js/svg.js
index 2132ad312..6476f16bf 100644
--- a/web_src/js/svg.js
+++ b/web_src/js/svg.js
@@ -80,7 +80,8 @@ export function svg(name, size = 16, className = '') {
const svgNode = document.firstChild;
if (size !== 16) svgNode.setAttribute('width', String(size));
if (size !== 16) svgNode.setAttribute('height', String(size));
- if (className) svgNode.classList.add(...className.split(/\s+/));
+ // filter array to remove empty string
+ if (className) svgNode.classList.add(...className.split(/\s+/).filter(Boolean));
return serializer.serializeToString(svgNode);
}