aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/docx-reader.js2
-rw-r--r--lib/xmlreader.js2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/docx-reader.js b/lib/docx-reader.js
index d30a822..44b3393 100644
--- a/lib/docx-reader.js
+++ b/lib/docx-reader.js
@@ -90,6 +90,8 @@ var xmlElementReaders = {
if (styleElement) {
properties.styleName = styleElement.attributes["w:val"];
}
+ properties.isBold = !!element.first("w:b");
+ properties.isItalic = !!element.first("w:i");
return properties;
},
diff --git a/lib/xmlreader.js b/lib/xmlreader.js
index 3efad63..7c15019 100644
--- a/lib/xmlreader.js
+++ b/lib/xmlreader.js
@@ -65,7 +65,7 @@ function mapValues(input, mapper, context) {
function Element(name, attributes, children) {
this.type = "element";
this.name = name;
- this.attributes = attributes;
+ this.attributes = attributes || {};
this.children = children || [];
}