diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-01-19 23:05:45 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-01-19 23:05:45 +0000 |
| commit | 965bd9513da033b9804af8ec29c7fa609a84512c (patch) | |
| tree | 28027622b24a00bb44fd4a1e9c91462493d78989 /lib/docx/document-xml-reader.js | |
| parent | 58cae6030e51481ffb462e52ab6aeb479e0a705d (diff) | |
Add support for endnotes
Diffstat (limited to 'lib/docx/document-xml-reader.js')
| -rw-r--r-- | lib/docx/document-xml-reader.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/docx/document-xml-reader.js b/lib/docx/document-xml-reader.js index c41a29f..2be726a 100644 --- a/lib/docx/document-xml-reader.js +++ b/lib/docx/document-xml-reader.js @@ -94,6 +94,16 @@ function DocumentXmlReader(options) { } } + function noteReferenceReader(noteType) { + return function(element) { + var noteId = element.attributes["w:id"]; + return new Result(new documents.NoteReference({ + noteType: noteType, + noteId: noteId + })); + }; + } + function readChildElements(element) { return readXmlElements(element.children); } @@ -175,12 +185,8 @@ function DocumentXmlReader(options) { "w:tc": function(element) { return readXmlElements(element.children).map(documents.TableCell); }, - "w:footnoteReference": function(element) { - var footnoteId = element.attributes["w:id"]; - return new Result(new documents.FootnoteReference({ - footnoteId: footnoteId - })); - }, + "w:footnoteReference": noteReferenceReader("footnote"), + "w:endnoteReference": noteReferenceReader("endnote"), "w:br": function(element) { var breakType = element.attributes["w:type"]; if (breakType) { |
