diff --git a/src/svg/SvgImport.js b/src/svg/SvgImport.js index 66d785e1..9b97668b 100644 --- a/src/svg/SvgImport.js +++ b/src/svg/SvgImport.js @@ -318,6 +318,9 @@ new function() { var spacing = 1.2; for (var i = 0; i < node.childNodes.length; i++) { var child = node.childNodes[i]; + // node.childNodes includes plaintext as well as elements. + // By checking for getAttribute, we ignore plaintext + // (node.children gets only elements but is not supported on Safari) if (!child.getAttribute) continue; lines.push(child.textContent); var dyString = child.getAttribute('dy');