From e02246641e636407db3fd5142ad1c074517a7db6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 6 Feb 2021 20:19:05 +0000 Subject: [PATCH] ordered lists bugfix: first line item can be 0.*, don't show 0 as undefined (#4600) --- src/node/utils/ExportTxt.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/node/utils/ExportTxt.js b/src/node/utils/ExportTxt.js index d97061364..ead3637ff 100644 --- a/src/node/utils/ExportTxt.js +++ b/src/node/utils/ExportTxt.js @@ -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++; }