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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An extra line break when using @if in $tmpl() #22288

Closed
syobocat opened this issue Sep 23, 2024 · 0 comments · Fixed by #22289
Closed

An extra line break when using @if in $tmpl() #22288

syobocat opened this issue Sep 23, 2024 · 0 comments · Fixed by #22289
Assignees
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@syobocat
Copy link

syobocat commented Sep 23, 2024

Describe the bug

@if in $tmpl() causes an unwanted line break to be inserted.

Reproduction Steps

Use @if in $tmpl(), like:

main.v

fn main() {
	cond := true
	template := $tmpl('template.txt')
	println(template)
}

template.txt

aaa
@if cond
bbb
@end
ccc

Expected Behavior

I expected

aaa
bbb
ccc

to be shown

Current Behavior

It shows

aaa

bbb
ccc

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.7 b79aa02

Environment details (OS name and version, etc.)

V full version: V 0.4.7 c0f7244.b79aa02
OS: macos, macOS, 15.0, 24A335
Processor: 8 cpus, 64bit, little endian, Apple M3

getwd: /Users/syobon/Devel/conditional
vexe: /Users/syobon/.v/v
vexe mtime: 2024-09-23 08:48:38

vroot: OK, value: /Users/syobon/.v
VMODULES: OK, value: /Users/syobon/.vmodules
VTMP: OK, value: /tmp/v_501

Git version: git version 2.39.5 (Apple Git-154)
Git vroot status: weekly.2024.37-51-gb79aa020
.git/config present: true

CC version: Apple clang version 16.0.0 (clang-1600.0.26.3)
thirdparty/tcc status: thirdparty-macos-arm64 713692d4

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@syobocat syobocat added the Bug This tag is applied to issues which reports bugs. label Sep 23, 2024
@felipensp felipensp self-assigned this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants