diff --git a/main.js b/main.js index 5b2a62e..d53c7d8 100644 --- a/main.js +++ b/main.js @@ -2095,16 +2095,26 @@ function applycolors() lines.every( (line, i) => { line = escapeHtml(line); + + // headings if (line.startsWith("#")) { - line = line.replace(/(#*)/g, "$1"); - line = "" + line + ""; + line = line.replace(/(#* )/, "$1"); // to check! + line = "" + line + ""; } + + // lists if (line.startsWith("* ")) { line = line.replace(/(\* )/g, "$1"); } + else if (line.startsWith("- ")) + { + line = line.replace(/(\- )/g, "$1"); + } + // todo: use markerslist + // md header if (i == 0 && line == "---") { header = true; @@ -2118,9 +2128,11 @@ function applycolors() line = "" + line + ""; } - if (line == "```" && !code) + // code blocks + if (line.startsWith("```") && !code) { code = true; + //lg = line.substring(3); line = "