Commit 6e3f8d24 authored by Nicholas Wylie's avatar Nicholas Wylie
Browse files

use existing start attribute as offset when setting data-item-num

parent 0504c329
......@@ -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