Coverage for m->d ordered list start attribute

This commit is contained in:
Cadence Ember 2023-11-23 13:41:31 +13:00
commit 8026cf0cad
2 changed files with 43 additions and 1 deletions

View file

@ -122,7 +122,7 @@ turndownService.addRule("listItem", {
if (parent.nodeName === "OL") {
var start = parent.getAttribute("start")
var index = Array.prototype.indexOf.call(parent.children, node)
prefix = (start ? Number(start) + index : index + 1) + ". "
prefix = (start ? Number(start) + index : index + 1) + ". "
}
return prefix + content + (node.nextSibling && !/\n$/.test(content) ? "\n" : "")
}