Update src/editor/deserialize.js

Co-Authored-By: Bruno Windels <bruno@windels.cloud>
This commit is contained in:
Tulir Asokan 2019-10-18 19:58:55 +03:00 committed by GitHub
parent a95f7be22d
commit 75bcc3f849
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,7 +109,8 @@ function parseElement(n, partCreator, lastNode, state) {
const indent = " ".repeat(state.listDepth - 1);
if (n.parentElement.nodeName === "OL") {
// The markdown parser doesn't do nested indexed lists at all, but this supports it anyway.
let index = state.listIndex[state.listIndex.length - 1]++;
let index = state.listIndex[state.listIndex.length - 1];
state.listIndex[state.listIndex.length - 1] += 1;
return partCreator.plain(`${indent}${index}. `);
} else {
return partCreator.plain(`${indent}- `);