From d64edfcf8ad73f773472a00416c3d3985eb499bf Mon Sep 17 00:00:00 2001 From: DD Liu Date: Thu, 25 Jul 2019 16:57:47 -0400 Subject: [PATCH] Solve without using node.children --- src/svg/SvgImport.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/svg/SvgImport.js b/src/svg/SvgImport.js index 6882f033..66d785e1 100644 --- a/src/svg/SvgImport.js +++ b/src/svg/SvgImport.js @@ -316,8 +316,9 @@ new function() { // Does not support x/y attribute or tspan positioning beyond left justified. var lines = []; var spacing = 1.2; - for (var i = 0; i < node.children.length; i++) { - var child = node.children[i]; + for (var i = 0; i < node.childNodes.length; i++) { + var child = node.childNodes[i]; + if (!child.getAttribute) continue; lines.push(child.textContent); var dyString = child.getAttribute('dy'); if (dyString) {