improved: code colors

This commit is contained in:
quenousimporte 2023-10-02 12:44:21 +02:00
parent 95eca37ebc
commit 05b438714e
1 changed files with 3 additions and 2 deletions

View File

@ -2173,14 +2173,15 @@ function applycolors()
}
else if (code)
{
line = line.replace(/(\d+)/g, "<span style='color:" + settings.accentcolor + "'>$1</span>");
if (languagekeywords[language])
{
var keywords = languagekeywords[language];
keywords.forEach(keyword =>
{
var r = new RegExp("(" + keyword + ")", "ig");
line = line.replace(new RegExp("\\b(" + keyword + ")\\b", "ig"), "<b>$1</b>");
})
line = line.replace(new RegExp("\\b(" + keyword + ")\\b", "ig"), "<span style='color:" + settings.accentcolor + "'><b>$1</b></span>");
});
}
}