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

Whitespace control inside of functions affects auto-indent of caller #553

Open
Arthri opened this issue Jun 23, 2024 · 0 comments
Open

Whitespace control inside of functions affects auto-indent of caller #553

Arthri opened this issue Jun 23, 2024 · 0 comments

Comments

@Arthri
Copy link
Contributor

Arthri commented Jun 23, 2024

Tested on .NET 8 and Scriban 5.10.0

Consider the following template,

{{ func x -}}
x {{ $0 }}
{
a
}
{{ end -}}
{
    {{ x 12 }}
}

which produces the following output

{
    x 12
    {
    a
    }

}

The following template is a variant of the above, but with whitespace control introduced

{{ func x -}}
x {{ $0 }}
{
    {{~ "a" }}
}
{{ end -}}
{
    {{ x 12 }}
}

Curiously, it instead produces the output

{
    x 12
    {
a
    }

}
@Arthri Arthri changed the title Whitespace Control leaks out of function scope Whitespace control inside of functions affects auto-indent of caller Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant