diff --git a/src/styles.css b/src/styles.css index eaaba95e..c172fb9e 100644 --- a/src/styles.css +++ b/src/styles.css @@ -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); diff --git a/src/ts/gui/highlight.ts b/src/ts/gui/highlight.ts index cfb4c908..1ab35889 100644 --- a/src/ts/gui/highlight.ts +++ b/src/ts/gui/highlight.ts @@ -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; } } }