From 24046d9f236bedbb839f98e95bf846b5b17e4055 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 19 Oct 2023 14:15:39 +0200 Subject: [PATCH] Revert "refactor: list markers" This reverts commit 1b0d25a9829af8784145c91c58e34b85c4421541. --- main.js | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/main.js b/main.js index ff006dd..082e36a 100644 --- a/main.js +++ b/main.js @@ -1997,27 +1997,12 @@ function applycolorsonline(line, linediv, index, options) span.appendChild(document.createTextNode(headingtext)); linediv.appendChild(span); } - } - else if (markerslist.every(marker => - { - if (line.startsWith(marker)) - { - var span = document.createElement("span"); - span.setAttribute("style", `color:${settings.accentcolor};`); - span.appendChild(document.createTextNode(marker.replaceAll("*", settings.bulletrendering))); - linediv.appendChild(span); - linediv.appendChild(document.createTextNode(line.substring(marker.length))); - return false; - } - return true; - })) - { - // fallback - linediv.appendChild(document.createTextNode(line || " ")); + return; } - - return; + // fallback + //linediv.appendChild(document.createTextNode(line || " ")); + //return; /* -----TODO------ */ @@ -2039,7 +2024,14 @@ function applycolorsonline(line, linediv, index, options) line = temp; } - + // lists + markerslist.forEach(marker => + { + if (line.startsWith(marker)) + { + line = line.replace(marker, "" + marker.replaceAll("*", settings.bulletrendering) + ""); + } + }); // md header if (index == 0 && line == "---")