Skip to content

Commit

Permalink
fmt: handle new vweb.html(path)
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed Nov 26, 2023
1 parent 51bb276 commit 643589a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vlib/v/fmt/fmt.v
Expand Up @@ -2086,7 +2086,13 @@ pub fn (mut f Fmt) chan_init(mut node ast.ChanInit) {
pub fn (mut f Fmt) comptime_call(node ast.ComptimeCall) {
if node.is_vweb {
if node.method_name == 'html' {
f.write('\$vweb.html()')
if node.args.len == 1 && node.args[0].expr is ast.StringLiteral {
f.write('\$vweb.html(')
f.expr(node.args[0].expr)
f.write(')')
} else {
f.write('\$vweb.html()')
}
} else {
f.write('\$tmpl(')
f.expr(node.args[0].expr)
Expand Down

0 comments on commit 643589a

Please sign in to comment.