diff options
Diffstat (limited to 'lib/docx/body-reader.js')
| -rw-r--r-- | lib/docx/body-reader.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js index 78c732e..28bd2ef 100644 --- a/lib/docx/body-reader.js +++ b/lib/docx/body-reader.js @@ -95,7 +95,7 @@ function BodyReader(options) { isStrikethrough: readBooleanElement(element.first("w:strike")), isAllCaps: readBooleanElement(element.first("w:caps")), isSmallCaps: readBooleanElement(element.first("w:smallCaps")), - highlight: element.firstOrEmpty("w:highlight").attributes["w:val"] + highlight: readHighlightValue(element.firstOrEmpty("w:highlight").attributes["w:val"]) }; }); } @@ -118,6 +118,14 @@ function BodyReader(options) { } } + function readHighlightValue(value) { + if (!value || value === "none") { + return null; + } else { + return value; + } + } + function readParagraphStyle(element) { return readStyle(element, "w:pStyle", "Paragraph", styles.findParagraphStyleById); } |
