Revert "refactor: list markers"

This reverts commit 1b0d25a982.
This commit is contained in:
quenousimporte 2023-10-19 14:15:39 +02:00
parent 1b0d25a982
commit 24046d9f23
1 changed files with 12 additions and 20 deletions

32
main.js
View File

@ -1997,27 +1997,12 @@ function applycolorsonline(line, linediv, index, options)
span.appendChild(document.createTextNode(headingtext)); span.appendChild(document.createTextNode(headingtext));
linediv.appendChild(span); linediv.appendChild(span);
} }
} return;
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 || " "));
} }
// fallback
return; //linediv.appendChild(document.createTextNode(line || " "));
//return;
/* -----TODO------ */ /* -----TODO------ */
@ -2039,7 +2024,14 @@ function applycolorsonline(line, linediv, index, options)
line = temp; line = temp;
} }
// lists
markerslist.forEach(marker =>
{
if (line.startsWith(marker))
{
line = line.replace(marker, "<span style='color:" + settings.accentcolor + "'>" + marker.replaceAll("*", settings.bulletrendering) + "</span>");
}
});
// md header // md header
if (index == 0 && line == "---") if (index == 0 && line == "---")