aboutsummaryrefslogtreecommitdiff
path: root/lib/docx/footnotes-reader.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/docx/footnotes-reader.js')
-rw-r--r--lib/docx/footnotes-reader.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/docx/footnotes-reader.js b/lib/docx/footnotes-reader.js
index c7ec98c..a653b8a 100644
--- a/lib/docx/footnotes-reader.js
+++ b/lib/docx/footnotes-reader.js
@@ -3,17 +3,11 @@ exports.readFootnotesXml = readFootnotesXml;
var Footnotes = require("../documents").Footnotes;
function readFootnotesXml(xml) {
- var footnotes = {};
-
- xml.root.getElementsByTagName("w:footnote").forEach(function(footnoteElement) {
- var id = footnoteElement.attributes["w:id"];
- footnotes[id] = readFootnoteElement(footnoteElement);
- });
-
- return new Footnotes(footnotes);
+ return xml.root.getElementsByTagName("w:footnote").map(readFootnoteElement);
}
function readFootnoteElement(footnoteElement) {
+ var id = footnoteElement.attributes["w:id"];
var body = footnoteElement.children;
- return {body: body};
+ return {id: id, body: body};
}