vdoc: escape tags in highlighted html (#19731)

This commit is contained in:
Turiiya 2023-11-02 19:58:50 +01:00 committed by GitHub
parent d33e7e7903
commit 59660746dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -534,10 +534,10 @@ fn (f &MdHtmlCodeHighlighter) transform_attribute(p markdown.ParentType, name st
fn (f &MdHtmlCodeHighlighter) transform_content(parent markdown.ParentType, text string) string {
if parent is markdown.MD_BLOCKTYPE && parent == .md_block_code {
if f.language == 'v' || f.language == 'vlang' {
return html_highlight(text, f.table)
return html_highlight(html_tag_escape(text), f.table)
}
}
return markdown.default_html_transformer.transform_content(parent, text)
return markdown.default_html_transformer.transform_content(parent, html_tag_escape(text))
}
fn (mut f MdHtmlCodeHighlighter) config_set(key string, val string) {