MCPcopy Create free account
hub / github.com/TruthHun/BookStack / readAbstractNum

Function readAbstractNum

static/word2md/mammoth.browser.js:1825–1839  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

1823}
1824
1825function readAbstractNum(element) {
1826 var levels = {};
1827 element.getElementsByTagName("w:lvl").forEach(function(levelElement) {
1828 var levelIndex = levelElement.attributes["w:ilvl"];
1829 var numFmt = levelElement.first("w:numFmt").attributes["w:val"];
1830 levels[levelIndex] = {
1831 isOrdered: numFmt !== "bullet",
1832 level: levelIndex
1833 };
1834 });
1835
1836 var numStyleLink = element.firstOrEmpty("w:numStyleLink").attributes["w:val"];
1837
1838 return {levels: levels, numStyleLink: numStyleLink};
1839}
1840
1841function readNums(root) {
1842 var nums = {};

Callers 1

readAbstractNumsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected