Commit ded5a9bf authored by Fred Chasen's avatar Fred Chasen
Browse files

Merge branch 'fix-ordered-list-start-override' into 'master'

Fix ordered list start attribute being overridden

Closes #130

See merge request !111
parents 0504c329 6e3f8d24
Pipeline #485 passed with stage
in 3 minutes and 35 seconds
......@@ -25,9 +25,16 @@ class Lists extends Handler {
}
addDataNumbers(list) {
let start = 1;
if (list.hasAttribute("start")) {
start = parseInt(list.getAttribute("start"), 10);
if (isNaN(start)) {
start = 1;
}
}
let items = list.children;
for (var i = 0; i < items.length; i++) {
items[i].setAttribute("data-item-num", i + 1);
items[i].setAttribute("data-item-num", i + start);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment