From ee2fc5da880df5f9ea8cdaebc506d130c3009ce3 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 10 Jun 2014 15:46:32 +0100 Subject: Read footnote references --- lib/docx/document-xml-reader.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/docx/document-xml-reader.js') diff --git a/lib/docx/document-xml-reader.js b/lib/docx/document-xml-reader.js index 462cd61..348bccf 100644 --- a/lib/docx/document-xml-reader.js +++ b/lib/docx/document-xml-reader.js @@ -14,6 +14,7 @@ function DocumentXmlReader(options) { var docxFile = options.docxFile; var numbering = options.numbering; var styles = options.styles; + var footnotes = options.footnotes; function convertXmlToDocument(documentXml) { @@ -21,7 +22,7 @@ function DocumentXmlReader(options) { var result = readXmlElements(body.children) .map(function(children) { - return new documents.Document(children); + return new documents.Document(children, footnotes); }); result.document = result.value; return result; @@ -137,6 +138,12 @@ function DocumentXmlReader(options) { } }); }, + "w:footnoteReference": function(element) { + var footnoteId = element.attributes["w:id"]; + return new Result(new documents.FootnoteReference({ + footnoteId: footnoteId + })); + }, "w:ins": readChildElements, "w:smartTag": readChildElements, -- cgit v1.2.3