aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-06-11 14:30:32 +0100
committerMichael Williamson <mike@zwobble.org>2014-06-11 14:30:32 +0100
commit48108d291a5b158ca6e4f4d830e832c116fd997e (patch)
treebf00c0eb8dd3d95998979b8f6bfb1a64043174be /lib
parent1b34a534ed15dab39e6805f29526a01f0394eea4 (diff)
Ignore footnote separators
Diffstat (limited to 'lib')
-rw-r--r--lib/docx/footnotes-reader.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/docx/footnotes-reader.js b/lib/docx/footnotes-reader.js
index a653b8a..33bca14 100644
--- a/lib/docx/footnotes-reader.js
+++ b/lib/docx/footnotes-reader.js
@@ -3,7 +3,14 @@ exports.readFootnotesXml = readFootnotesXml;
var Footnotes = require("../documents").Footnotes;
function readFootnotesXml(xml) {
- return xml.root.getElementsByTagName("w:footnote").map(readFootnoteElement);
+ return xml.root.getElementsByTagName("w:footnote")
+ .filter(isFootnoteElement)
+ .map(readFootnoteElement);
+}
+
+function isFootnoteElement(element) {
+ var type = element.attributes["w:type"];
+ return type !== "continuationSeparator" && type !== "separator";
}
function readFootnoteElement(footnoteElement) {