From 0cd2f2ef233572e4b2795ecbfa7a4edd29fd8945 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 12 Apr 2020 15:04:28 +0100 Subject: Only parse integer font sizes --- lib/docx/body-reader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js index 94034d1..23c6a20 100644 --- a/lib/docx/body-reader.js +++ b/lib/docx/body-reader.js @@ -60,7 +60,7 @@ function BodyReader(options) { return readRunStyle(element).map(function(style) { var fontSizeString = element.firstOrEmpty("w:sz").attributes["w:val"]; // w:sz gives the font size in half points, so halve the value to get the size in points - var fontSize = fontSizeString ? parseInt(fontSizeString, 10) / 2 : null; + var fontSize = /^[0-9]+$/.test(fontSizeString) ? parseInt(fontSizeString, 10) / 2 : null; return { type: "runProperties", -- cgit v1.2.3