Skip to content

Commit 643589a

Browse files
committed
fmt: handle new vweb.html(path)
1 parent 51bb276 commit 643589a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

vlib/v/fmt/fmt.v

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,13 @@ pub fn (mut f Fmt) chan_init(mut node ast.ChanInit) {
20862086
pub fn (mut f Fmt) comptime_call(node ast.ComptimeCall) {
20872087
if node.is_vweb {
20882088
if node.method_name == 'html' {
2089-
f.write('\$vweb.html()')
2089+
if node.args.len == 1 && node.args[0].expr is ast.StringLiteral {
2090+
f.write('\$vweb.html(')
2091+
f.expr(node.args[0].expr)
2092+
f.write(')')
2093+
} else {
2094+
f.write('\$vweb.html()')
2095+
}
20902096
} else {
20912097
f.write('\$tmpl(')
20922098
f.expr(node.args[0].expr)

0 commit comments

Comments
 (0)