summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2020-04-12 15:04:28 +0100
committerMichael Williamson <mike@zwobble.org>2020-04-12 15:04:28 +0100
commit0cd2f2ef233572e4b2795ecbfa7a4edd29fd8945 (patch)
tree4fcaebf14bc1924d193e58f58b9decde3cf4ddcc /lib
parent722bf9f5312581f35dddc076ea9774315532b4ee (diff)
Only parse integer font sizes
Diffstat (limited to 'lib')
-rw-r--r--lib/docx/body-reader.js2
1 files changed, 1 insertions, 1 deletions
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",