diff --git a/tools/server/public_simplechat/typemd.mjs b/tools/server/public_simplechat/typemd.mjs index a1d3eab57e..fe67b9e7f8 100644 --- a/tools/server/public_simplechat/typemd.mjs +++ b/tools/server/public_simplechat/typemd.mjs @@ -27,18 +27,19 @@ export class MarkDown { this.in.pre = false this.html += "\n" } else { - this.html += line + this.html += `${line}\n` } return } if (line.startsWith ("#")) { let hLevel = lineA[0].length - this.html += `${lineRStripped}\n` + this.html += `${line.slice(hLevel)}\n` return } - if (lineA[0] == '```') { + let matchPre = line.match(/^```([a-zA-Z0-9]*)(.*)/); + if ( matchPre != null) { this.in.pre = true - this.html += "
\n"
+            this.html += `
\n`
             return
         }
         this.html += `

${line}

`