vdoc: highlight inline examples for -f html (#13879)

This commit is contained in:
Nick Treleaven 2022-03-31 17:32:32 +01:00 committed by GitHub
parent 5c43493183
commit a87cd9663e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 9 deletions

View file

@ -430,8 +430,8 @@ fn doc_node_html(dn doc.DocNode, link string, head bool, include_examples bool,
example_title := if examples.len > 1 { 'Examples' } else { 'Example' }
dnw.writeln('<section class="doc-node examples"><h4>$example_title</h4>')
for example in examples {
// hl_example := html_highlight(example, tb)
dnw.writeln('<pre><code class="language-v">$example</code></pre>')
hl_example := html_highlight(example, tb)
dnw.writeln('<pre><code class="language-v">$hl_example</code></pre>')
}
dnw.writeln('</section>')
}