From 9c1981a3097b14a8027e23acb4bceeafbd0003f0 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Thu, 31 Mar 2022 18:00:06 +0100 Subject: [PATCH] vdoc: show `//` comment prefix and hide any \x01 character (#13880) --- cmd/tools/vdoc/html.v | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/tools/vdoc/html.v b/cmd/tools/vdoc/html.v index 70cbf879aa..4a2e8f4133 100644 --- a/cmd/tools/vdoc/html.v +++ b/cmd/tools/vdoc/html.v @@ -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 }