aboutsummaryrefslogtreecommitdiff
path: root/lib/docx/document-xml-reader.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-04-22 11:59:49 +0100
committerMichael Williamson <mike@zwobble.org>2014-04-22 11:59:49 +0100
commit0326c56e24f7333381c7ef8c17aba0ac8380c02b (patch)
tree2e687550e65551245c900b1d332fe5c5175ae8a5 /lib/docx/document-xml-reader.js
parent354114f396bd864b199c3f46852acc1beb3c5672 (diff)
Add styleName property to Paragraph
Diffstat (limited to 'lib/docx/document-xml-reader.js')
-rw-r--r--lib/docx/document-xml-reader.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/docx/document-xml-reader.js b/lib/docx/document-xml-reader.js
index fc4b630..da95a36 100644
--- a/lib/docx/document-xml-reader.js
+++ b/lib/docx/document-xml-reader.js
@@ -13,6 +13,7 @@ function DocumentXmlReader(options) {
var contentTypes = options.contentTypes;
var docxFile = options.docxFile;
var numbering = options.numbering;
+ var styles = options.styles;
function convertXmlToDocument(documentXml) {
@@ -68,7 +69,12 @@ function DocumentXmlReader(options) {
var styleElement = element.first("w:pStyle");
if (styleElement) {
- properties.styleId = styleElement.attributes["w:val"];
+ var styleId = styleElement.attributes["w:val"];
+ properties.styleId = styleId;
+ if (styleId) {
+ var style = styles.findParagraphStyleById(styleId);
+ properties.styleName = style.name;
+ }
}
var alignElement = element.first("w:jc");
if (alignElement) {