diff --git a/tools/server/public_simplechat/typemd.mjs b/tools/server/public_simplechat/typemd.mjs index 100ff04519..3d2f90f0ca 100644 --- a/tools/server/public_simplechat/typemd.mjs +++ b/tools/server/public_simplechat/typemd.mjs @@ -25,7 +25,11 @@ export class MarkDown { /** @type {Array} */ listUnordered: [] } - this.md = "" + /** + * @type {Array<*>} + */ + this.errors = [] + this.raw = "" this.html = "" } @@ -40,6 +44,48 @@ export class MarkDown { this.unwind_list_unordered() } + /** + * Process a unordered list one line at a time + * @param {string} line + */ + process_list_unordered(line) { + // spaces followed by - or + or * followed by a space and actual list item + let matchUnOrdered = line.match(/^([ ]*)[-+*][ ](.*)$/); + if (matchUnOrdered != null) { + let sList = 'none' + let listLvl = 0 + if (this.in.listUnordered.length == 0) { + sList = 'same' + this.in.listUnordered.push(matchUnOrdered[1].length) + listLvl = this.in.listUnordered.length // ie 1 + this.html += "