added(colors): comments in code blocks
This commit is contained in:
parent
d5b261cc88
commit
62b28afedd
10
main.js
10
main.js
|
@ -2047,7 +2047,7 @@ function rawline2html(line, index, options)
|
||||||
// lists
|
// lists
|
||||||
markerslist.forEach(marker =>
|
markerslist.forEach(marker =>
|
||||||
{
|
{
|
||||||
if (line.startsWith(marker))
|
if (line.startsWith(marker) && marker.trim())
|
||||||
{
|
{
|
||||||
line = line.replace(marker, "<span style='color:" + settings.accentcolor + "'>" + marker + "</span>");
|
line = line.replace(marker, "<span style='color:" + settings.accentcolor + "'>" + marker + "</span>");
|
||||||
}
|
}
|
||||||
|
@ -2089,11 +2089,17 @@ function rawline2html(line, index, options)
|
||||||
}
|
}
|
||||||
else if (options.code)
|
else if (options.code)
|
||||||
{
|
{
|
||||||
|
var comment = false;
|
||||||
|
if (line.match(/^\s*\/\//))
|
||||||
|
{
|
||||||
|
line = "<span style='color:grey'>" + line + "</span>";
|
||||||
|
comment = true;
|
||||||
|
}
|
||||||
if (settings.darkcode)
|
if (settings.darkcode)
|
||||||
{
|
{
|
||||||
line = "<div class='color-code'>" + (line || emptyline) + "</div>";
|
line = "<div class='color-code'>" + (line || emptyline) + "</div>";
|
||||||
}
|
}
|
||||||
if (languagekeywords[options.language])
|
if (!comment && languagekeywords[options.language])
|
||||||
{
|
{
|
||||||
var keywords = languagekeywords[options.language];
|
var keywords = languagekeywords[options.language];
|
||||||
keywords.forEach(keyword =>
|
keywords.forEach(keyword =>
|
||||||
|
|
Loading…
Reference in New Issue