diff --git a/tools/server/public_simplechat/typemd.mjs b/tools/server/public_simplechat/typemd.mjs index a7f6017568..05ba522ff9 100644 --- a/tools/server/public_simplechat/typemd.mjs +++ b/tools/server/public_simplechat/typemd.mjs @@ -54,37 +54,28 @@ export class MarkDown { // spaces followed by - or + or * followed by a space and actual list item let matchUnOrdered = line.match(/^([ ]*)([-+*]|[a-zA-Z0-9]\.)[ ](.*)$/); if (matchUnOrdered != null) { - let sList = 'none' let listLvl = 0 let curOffset = matchUnOrdered[1].length - if (this.in.list.offsets.length == 0) { - sList = 'same' + let lastOffset = this.in.list.offsets[this.in.list.offsets.length-1]; + if (lastOffset == undefined) { + lastOffset = -1 + } + + if (lastOffset < curOffset){ this.in.list.offsets.push(curOffset) - listLvl = this.in.list.offsets.length // ie 1 + listLvl = this.in.list.offsets.length this.html += "