resolve remarks

* use join
* don't use arrow functions
This commit is contained in:
DanielHabenicht 2021-05-31 09:53:43 +00:00 committed by GitHub
parent e7727bb36c
commit af18dd5de4

View file

@ -31,12 +31,15 @@
var styleNode = document.createElement("style");
// Copy the stylesheets from the whiteboard to the exported SVG
stylesheets = document.styleSheets;
styleText = "";
Array.from(stylesheets).forEach(stylesheet => {
styleText += "\n" + Array.from(stylesheet.cssRules).map(x => x.cssText).join("\n");
});
styleNode.innerHTML = styleText;
styleNode.innerHTML = Array.from(document.styleSheets).map(
function (stylesheet) {
return Array.from(stylesheet.cssRules).map(
function (rule) {
return rule.cssText
}
)}
).join("\n")
canvasCopy.appendChild(styleNode);
downloadContent('data:image/svg+xml;charset=utf-8,' + encodeURIComponent(canvasCopy.outerHTML), "svg")
}