diff --git a/tools/server/public_simplechat/typemd.mjs b/tools/server/public_simplechat/typemd.mjs index 0f40603865..a06032d16f 100644 --- a/tools/server/public_simplechat/typemd.mjs +++ b/tools/server/public_simplechat/typemd.mjs @@ -9,7 +9,7 @@ export class MarkDown { constructor() { this.in = { preFenced: "", - table: false, + table: 0, /** @type {Array} */ listUnordered: [] } @@ -28,6 +28,28 @@ export class MarkDown { this.unwind_list_unordered() } + /** + * @param {string} line + */ + process_table_line(line) { + let lineParts = line.match(/^(|.*)*|$/) + if (lineParts != null) { + if (this.in.table == 0) { + // table heading + this.html += "\n\n" + for(let i=1; i${lineParts[i]}\n` + } + this.html += "\n" + this.in.table = lineParts.length-1; + return + } + if (this.in.table > 0) { + + } + } + } + /** * Process a line from markdown content * @param {string} line