1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vdoc: fix panic on empty // comment on v doc -f html file.v; turn expected code block after empty example to a warning

This commit is contained in:
Delyan Angelov
2022-05-02 23:48:37 +03:00
parent cf92224248
commit 4da2908d63
6 changed files with 36 additions and 13 deletions

View File

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