Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

vdoc: escape tags in highlighted html #19731

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/tools/vdoc/html.v
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,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) {
Expand Down