aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-01-07 21:37:21 +0000
committerMichael Williamson <mike@zwobble.org>2014-01-07 21:37:21 +0000
commitd9d55dece1861bbbf08f3688254447992cf1957f (patch)
tree6c56fd5f00ebf4de9a8fbc0f202836dc262e84a3 /lib
parent53e9f9200a781e488830c3c01ff58f50d667a812 (diff)
parent51c625fb8474bcf790a0341ae5bbabb1316a2583 (diff)
Merge remote-tracking branch 'offlein/master'
Conflicts: lib/index.js
Diffstat (limited to 'lib')
-rw-r--r--lib/document-xml-reader.js4
-rw-r--r--lib/documents.js3
-rw-r--r--lib/index.js7
3 files changed, 13 insertions, 1 deletions
diff --git a/lib/document-xml-reader.js b/lib/document-xml-reader.js
index f4ab760..0dcd624 100644
--- a/lib/document-xml-reader.js
+++ b/lib/document-xml-reader.js
@@ -65,6 +65,10 @@ function DocumentXmlReader(relationships, contentTypes, docxFile, numbering) {
if (styleElement) {
properties.styleName = styleElement.attributes["w:val"];
}
+ var alignElement = element.first("w:jc");
+ if (alignElement) {
+ properties.alignment = alignElement.attributes["w:val"];
+ }
var numberingPropertiesElement = element.first("w:numPr");
if (numberingPropertiesElement) {
var levelElement = numberingPropertiesElement.first("w:ilvl");
diff --git a/lib/documents.js b/lib/documents.js
index 4dfbe74..3af5bd5 100644
--- a/lib/documents.js
+++ b/lib/documents.js
@@ -11,7 +11,8 @@ function Paragraph(children, properties) {
type: "paragraph",
children: children,
styleName: properties.styleName || null,
- numbering: properties.numbering || null
+ numbering: properties.numbering || null,
+ alignment: properties.alignment || null
};
}
diff --git a/lib/index.js b/lib/index.js
index bec626c..1928424 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -38,6 +38,13 @@ function convertToHtml(input, options) {
return docxReader.read(input)
.then(function(documentResult) {
+ if (fullOptions.transformDocument) {
+ return fullOptions.transformDocument(documentResult);
+ } else {
+ return documentResult;
+ }
+ })
+ .then(function(documentResult) {
return convertDocumentToHtml(documentResult, fullOptions);
});
}