From 1da35be148eb9b528fdf11d1dd97bd6fbb92d40f Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 6 Jul 2021 16:14:35 -0700 Subject: [PATCH] Better handle list start attribute. --- src/platform/web/dom/deserialize.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/platform/web/dom/deserialize.js b/src/platform/web/dom/deserialize.js index aa0b324a..c036a059 100644 --- a/src/platform/web/dom/deserialize.js +++ b/src/platform/web/dom/deserialize.js @@ -35,8 +35,11 @@ function parseLink(result, node, children) { } function parseList(result, node) { - // TODO Attribute's a string. - const start = result.getAttributeValue(node, "start") || 1; + let start = null; + 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 = []; for (const child of result.getChildNodes(node)) { if (result.getNodeElementName(child) !== "LI") {