Better handle list start attribute.
This commit is contained in:
parent
e56b15237e
commit
1da35be148
1 changed files with 5 additions and 2 deletions
|
@ -35,8 +35,11 @@ function parseLink(result, node, children) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseList(result, node) {
|
function parseList(result, node) {
|
||||||
// TODO Attribute's a string.
|
let start = null;
|
||||||
const start = result.getAttributeValue(node, "start") || 1;
|
if (result.getNodeElementName(node) == "OL") {
|
||||||
|
// Will return 1 for, say, '1A', which may not be intended?
|
||||||
|
start = parseInt(result.getAttributeValue(node, "start")) || 1;
|
||||||
|
}
|
||||||
const nodes = [];
|
const nodes = [];
|
||||||
for (const child of result.getChildNodes(node)) {
|
for (const child of result.getChildNodes(node)) {
|
||||||
if (result.getNodeElementName(child) !== "LI") {
|
if (result.getNodeElementName(child) !== "LI") {
|
||||||
|
|
Reference in a new issue