vdoc: highlight terminal examples for -comments -color (#13937)

This commit is contained in:
Nick Treleaven 2022-04-04 16:13:24 +01:00 committed by GitHub
parent aa9e2ebb25
commit 2cd9c91e98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 6 deletions

View file

@ -161,6 +161,9 @@ fn color_highlight(code string, tb &ast.Table) string {
.char {
lit = term.yellow('`$tok.lit`')
}
.comment {
lit = if tok.lit[0] == 1 { '//${tok.lit[1..]}' } else { '//$tok.lit' }
}
.keyword {
lit = term.bright_blue(tok.lit)
}