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

vdoc: fix markdown and plaintext rendering (#6882)

This commit is contained in:
Ned Palacios
2020-11-20 18:02:52 +08:00
committed by GitHub
parent ef3e8d2c84
commit 7c2c187743
3 changed files with 39 additions and 20 deletions

View File

@@ -296,6 +296,9 @@ pub fn (mut d Doc) file_ast(file_ast ast.File) map[string]DocNode {
}
}
d.fmt.mod2alias = map[string]string{}
if contents[''].kind != .const_group {
contents.delete('')
}
return contents
}

View File

@@ -13,6 +13,6 @@ fn test_generate_from_mod() {
}
assert nested_mod_doc.head.name == nested_mod_name
assert nested_mod_doc.head.content == 'module $nested_mod_name'
assert nested_mod_doc.contents.len == 4
assert nested_mod_doc.contents.len == 3
assert nested_mod_doc.contents['ChunkScanner'].children.len == 3
}