blob: 00bcce5f9f4a4e8a2480df183f51104039d50600 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
exports.readFootnotesXml = createReader("footnote");
function createReader(noteType) {
function readNotesXml(xml) {
return xml.root.getElementsByTagName("w:" + noteType)
.filter(isFootnoteElement)
.map(readFootnoteElement);
}
function isFootnoteElement(element) {
var type = element.attributes["w:type"];
return type !== "continuationSeparator" && type !== "separator";
}
function readFootnoteElement(footnoteElement) {
var id = footnoteElement.attributes["w:id"];
var body = footnoteElement.children;
return {noteType: noteType, id: id, body: body};
}
return readNotesXml;
}
|