feat: Add support for highlighting comments in GUI

This commit is contained in:
kwaroran
2024-05-26 08:33:48 +09:00
parent cb130d44ba
commit 950ac1d46e
2 changed files with 10 additions and 0 deletions

View File

@@ -211,6 +211,9 @@ html, body{
::highlight(cbsdisplay) {
@apply text-cyan-500;
}
::highlight(comment) {
color: var(--risu-theme-textcolor2);
}
::highlight(decorator) {
color: var(--risu-theme-draculared);

View File

@@ -210,6 +210,10 @@ function simpleCBSHighlightParser(node:Node,text:string){
}
}
if(upString.startsWith('// ')){
highlightMode[depth] = 4
}
colorHighlight()
}
}
@@ -229,6 +233,9 @@ function simpleCBSHighlightParser(node:Node,text:string){
case 3:
ranges.push([range, 'deprecated'])
break;
case 4:
ranges.push([range, 'comment'])
break;
}
}
}