vdoc: show `//` comment prefix and hide any \x01 character (#13880)

pull/13861/head
Nick Treleaven 2022-03-31 18:00:06 +01:00 committed by GitHub
parent bc98c11d9d
commit 9c1981a309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -302,6 +302,8 @@ fn html_highlight(code string, tb &ast.Table) string {
"'$tok.lit'"
} else if typ == .char {
'`$tok.lit`'
} else if typ == .comment {
if tok.lit[0] == 1 { '//${tok.lit[1..]}' } else { '//$tok.lit' }
} else {
tok.lit
}