Skip to content

Conversation

@anya-hichu
Copy link
Contributor

Unfortunately I cannot compile the project due to SDK version mismatch, but here is the proposal I had in mind to fix #634

@anya-hichu anya-hichu changed the title WIP: Proposal to fix #634 Draft: Proposal to fix #634 Nov 18, 2025
@anya-hichu anya-hichu marked this pull request as draft November 18, 2025 16:41
@anya-hichu
Copy link
Contributor Author

anya-hichu commented Nov 18, 2025

Tested with a subclass in my project (see related issue) and it appears to be working:

var script = """[["a", "b"]] | array.each @(do; ret $0 | array.join("#"); end)""";

var context = new FixedTemplateContext();
var result = Scriban.Template.Evaluate(script, context);
Console.WriteLine(context.ObjectToString(result));

Correctly outputs:

["a#b"]

@xoofx
Copy link
Member

xoofx commented Nov 20, 2025

Tested with a subclass in my project (see related issue) and it appears to be working:

Could you add this as a test in TestRuntime.cs so that we capture the case and avoid regressions?

@xoofx
Copy link
Member

xoofx commented Nov 20, 2025

There is a stack overflow happening in the tests.

Unfortunately I cannot compile the project due to SDK version mismatch,

You have to install .NET 10 in order to run the tests locally.

@anya-hichu
Copy link
Contributor Author

will see what I can do, thanks

@anya-hichu anya-hichu changed the title Draft: Proposal to fix #634 Fix #634: ObjectToString has side-effect leading to incorrect escaping with lazy evaluation Nov 24, 2025
@anya-hichu anya-hichu marked this pull request as ready for review November 24, 2025 11:04
@xoofx xoofx merged commit 88e7748 into scriban:master Nov 25, 2025
1 check passed
@xoofx
Copy link
Member

xoofx commented Nov 25, 2025

Thank you!

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

Successfully merging this pull request may close these issues.

ObjectToString has side-effect leading to incorrect escaping with lazy evaluation

2 participants