From 27887528809530e28e373587ff1d9999a6f0ee50 Mon Sep 17 00:00:00 2001 From: hanishkvc Date: Wed, 26 Nov 2025 12:36:13 +0530 Subject: [PATCH] SimpleChatTCRV:Markdown:OrdUnOrded: EndType tracker initial go --- tools/server/public_simplechat/typemd.mjs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/server/public_simplechat/typemd.mjs b/tools/server/public_simplechat/typemd.mjs index 05ba522ff9..7964223c2c 100644 --- a/tools/server/public_simplechat/typemd.mjs +++ b/tools/server/public_simplechat/typemd.mjs @@ -25,6 +25,8 @@ export class MarkDown { list: { /** @type {Array} */ offsets: [], + /** @type {Array} */ + endType: [], } } /** @@ -36,8 +38,12 @@ export class MarkDown { } unwind_list_unordered() { - for(const i in this.in.list.offsets) { - this.html += "\n" + while (true) { + let popped = this.in.list.endType.pop() + if (popped == undefined) { + break + } + this.html += popped } this.in.list.offsets.length = 0 } @@ -65,10 +71,12 @@ export class MarkDown { this.in.list.offsets.push(curOffset) listLvl = this.in.list.offsets.length this.html += "
    \n" + this.in.list.endType.push("
\n") } else if (lastOffset > curOffset){ while (this.in.list.offsets[this.in.list.offsets.length-1] > curOffset) { this.in.list.offsets.pop() - this.html += `\n` + let popped = this.in.list.endType.pop() + this.html += popped; if (this.in.list.offsets.length == 0) { break }