From 134070dea369de4516fd0d7b3538e68b0d7e695e Mon Sep 17 00:00:00 2001 From: DD Liu Date: Mon, 29 Jul 2019 11:20:01 -0400 Subject: [PATCH] Comment --- src/svg/SvgImport.js | 3 +++ 1 file changed, 3 insertions(+) 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');