From b73d152aeb145e5cc4ea44dfb5c26dfabfa83b4a Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Mon, 25 Sep 2023 12:05:34 +0200 Subject: [PATCH] fix(colors): bold and italics improve(colors): consider all list markers --- main.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/main.js b/main.js index d53c7d8..3fcef62 100644 --- a/main.js +++ b/main.js @@ -2104,15 +2104,13 @@ function applycolors() } // lists - if (line.startsWith("* ")) + markerslist.forEach(marker => { - line = line.replace(/(\* )/g, "$1"); - } - else if (line.startsWith("- ")) - { - line = line.replace(/(\- )/g, "$1"); - } - // todo: use markerslist + if (line.startsWith(marker)) + { + line = line.replace(marker, "" + marker + ""); + } + }); // md header if (i == 0 && line == "---") @@ -2153,7 +2151,7 @@ function applycolors() // bold and italics line = line.replace(/(\*\*.*\*\*)/g, "$1"); - line = line.replace(/(\*.*\*)/g, "$1"); + line = line.replace(/(^\*\*.*\*)/g, "$1"); // comments line = line.replace(/<\!/g, "<!");