From 643589ab888ec7d9d1366141ed2a520f98045552 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 26 Nov 2023 07:12:35 +0300 Subject: [PATCH] fmt: handle new vweb.html(path) --- vlib/v/fmt/fmt.v | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index af2a4aa301169d..3a0b5c07465e37 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -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)