From 326049ba556e6d11ac6e129090696ff36f07a348 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Fri, 22 May 2020 17:28:33 -0700
Subject: [PATCH] Trim SVG data before parsing and caching it.  Tweego is nice
 enough to trim whitespace from passages and scripts but not from SVG files,
 so we get thousands of extra text nodes created unless we trim the data.

---
 src/art/artJS.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/art/artJS.js b/src/art/artJS.js
index 00bc04a24dc..ac110619480 100644
--- a/src/art/artJS.js
+++ b/src/art/artJS.js
@@ -1929,7 +1929,7 @@ App.Art.cacheArtData = function() {
 			let div = document.createElement("div");
 			div.id = "div-" + name;
 			const svgData = atob(ip.innerHTML.replace(/data:image\/svg\+xml;base64,/, ''));
-			div.innerHTML = svgData;
+			div.innerHTML = svgData.trim();
 			obj.nodes.appendChild(div);
 			obj.dict.set(name, obj.dict.size);
 		}
-- 
GitLab