diff --git a/cmd/tools/vdoc/vdoc.v b/cmd/tools/vdoc/vdoc.v index 4c9cc501c4..91fe834d81 100644 --- a/cmd/tools/vdoc/vdoc.v +++ b/cmd/tools/vdoc/vdoc.v @@ -399,7 +399,7 @@ fn doc_node_html(dd doc.DocNode, link string, head bool, tb &table.Table) string mut dnw := strings.new_builder(200) link_svg := '' head_tag := if head { 'h1' } else { 'h2' } - md_content := markdown.to_html(dd.comment) + md_content := markdown.to_html(html_tag_escape(dd.comment)) hlighted_code := html_highlight(dd.content, tb) node_class := if dd.kind == .const_group { ' const' } else { '' } sym_name := get_sym_name(dd) @@ -433,6 +433,10 @@ fn doc_node_html(dd doc.DocNode, link string, head bool, tb &table.Table) string return dnw_str } +fn html_tag_escape(str string) string { + return str.replace_each(['<', '<', '>', '>']) +} + fn get_sym_name(dn doc.DocNode) string { sym_name := if dn.parent_name.len > 0 && dn.parent_name != 'void' { '($dn.parent_name) $dn.name'