From 3a8ae840f6ec6617bdafe239ee472d6f37741987 Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Tue, 29 Jan 2019 01:58:49 +0200 Subject: [PATCH] Allow style arrays to affect font properties --- lib/extract/extractText.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/extract/extractText.js b/lib/extract/extractText.js index 930d5057..b1fcbc67 100644 --- a/lib/extract/extractText.js +++ b/lib/extract/extractText.js @@ -42,7 +42,8 @@ function parseFontString(font) { } export function extractFont(prop) { - const props = { ...prop.style, ...prop }; + const style = prop.style; + const props = { ...(style && style.length ? Object.assign({}, ...style) : style), ...prop }; const { fontData, fontStyle, @@ -97,7 +98,7 @@ function getChild(child) { } } -export default function extractText(props, container = false) { +export default function extractText(props, container) { const { x, y,