Skip to content

Commit

Permalink
vdoc: minor cleanup (#21225)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Apr 8, 2024
1 parent 0fd67b2 commit 4e8d00d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/tools/vdoc/html.v
Expand Up @@ -17,7 +17,7 @@ const link_svg = '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0

const single_quote = "'"
const double_quote = '"'
const no_quotes_replacement = [single_quote, '', double_quote, '']
const quote_escape_seq = [single_quote, '', double_quote, '']

enum HighlightTokenTyp {
unone
Expand Down Expand Up @@ -542,7 +542,7 @@ fn doc_node_html(dn doc.DocNode, link string, head bool, include_examples bool,
dnw.write_string('</div>\n')
}
if deprecated_tags.len > 0 {
attributes := deprecated_tags.map('<div class="attribute attribute-deprecated">${no_quotes(it)}</div>\n').join('')
attributes := deprecated_tags.map('<div class="attribute attribute-deprecated">${it.replace_each(quote_escape_seq)}</div>\n').join('')
dnw.writeln('<div class="attributes">${attributes}</div>\n')
}
if tags.len > 0 {
Expand Down Expand Up @@ -598,10 +598,6 @@ fn write_toc(dn doc.DocNode, mut toc strings.Builder) {
toc.writeln('</li>')
}

fn no_quotes(s string) string {
return s.replace_each(no_quotes_replacement)
}

struct MdHtmlCodeHighlighter {
mut:
language string
Expand Down

0 comments on commit 4e8d00d

Please sign in to comment.