ordered lists bugfix: first line item can be 0.*, don't show 0 as undefined (#4600)

This commit is contained in:
John McLear 2021-02-06 20:19:05 +00:00 committed by GitHub
parent 4862d6fa9c
commit e02246641e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,6 +237,8 @@ const getTXTFromAtext = (pad, atext, authorColors) => {
if (line.listLevel > 1) {
let x = 1;
while (x <= line.listLevel - 1) {
// if it's undefined to avoid undefined.undefined.1 for 0.0.1
if (!listNumbers[x]) listNumbers[x] = 0;
pieces.push(`${listNumbers[x]}.`);
x++;
}