added: color inline code and links
This commit is contained in:
parent
107a382b9c
commit
1cb23c7108
16
main.js
16
main.js
|
@ -2245,9 +2245,12 @@ function rawline2html(line, index, options)
|
|||
.filter(s => s.command.startsWith(snippetpart))
|
||||
.map(s => s.command.substring(1));
|
||||
|
||||
line += "<span style='color:lightgrey'>";
|
||||
line += matching.join().substr(pos - slashpos - 1);
|
||||
line += "</span>";
|
||||
if (matching.length)
|
||||
{
|
||||
line += "<span style='color:lightgrey'>";
|
||||
line += matching.join().substr(pos - slashpos - 1);
|
||||
line += "</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2266,6 +2269,13 @@ function rawline2html(line, index, options)
|
|||
line = line.replace(/(\s\+\w*)/g, "<span style='color:grey'>$1</span>");
|
||||
}
|
||||
}
|
||||
|
||||
// inline code
|
||||
line = line.replace(/`(.*)`/, "<span class='color-code'>`$1`</span>");
|
||||
|
||||
// links
|
||||
line = line.replace(/(http[^\s]*)/, "<u>$1</u>");
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue