From f331cea76986447fc7bb3060dac16f095c457ef6 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Thu, 1 Nov 2018 15:01:52 -0400 Subject: [PATCH] Inline only a small number of properties --- src/lib/backpack/block-to-image.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/backpack/block-to-image.js b/src/lib/backpack/block-to-image.js index f3016fdbf..8c38d29bc 100644 --- a/src/lib/backpack/block-to-image.js +++ b/src/lib/backpack/block-to-image.js @@ -37,7 +37,12 @@ export default function (blockId) { // not all the styles are set directly on the SVG. This makes the // image styled the same way the block actually appears. // TODO this doesn't handle images that are xlink:href in the SVG - computedStyleToInlineStyle(svg, {recursive: true}); + computedStyleToInlineStyle(svg, { + recursive: true, + // Enumerate the specific properties we need to inline. + // Specifically properties that are set from CSS in scratch-blocks + properties: ['fill', 'font-family', 'font-size', 'font-weight'] + }); const svgString = (new XMLSerializer()).serializeToString(svg);