From 6bbd4d2d88666b5fd938997604859e6a1aa25cde Mon Sep 17 00:00:00 2001 From: Goran Gajic Date: Tue, 6 Sep 2016 19:33:04 +0200 Subject: [PATCH] fix passing numbers to Text element --- lib/extract/extractText.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/extract/extractText.js b/lib/extract/extractText.js index 7a44f2ed..a04eda5a 100644 --- a/lib/extract/extractText.js +++ b/lib/extract/extractText.js @@ -8,9 +8,12 @@ const fontFamilySuffix = /[\s"']*$/; let cachedFontObjectsFromString = {}; function childrenAsString(children) { - if (!children) { + if (typeof children === 'undefined') { return ''; } + if (typeof children === 'number') { + return children.toString(); + } if (typeof children === 'string') { return children; }