The include with a with operator should not be iterating IEnumerable objects. The for operator is for iterating the template for each item in an IEnumerable, but the with operator is only supposed to pass the variable to the included template. It was added because liquid was unable to pass variables that had the same name as the template itself.
Actual behavior
The with operator acts just like for. This is particularly problematic, when a string is passed, because of a second issue: DotLiquid treats strings as arrays of characters (because they implement IEnumerable), resulting in the included template being rendered once for each character in the string.
I have fixed both of these issued and would like to make a pull request. Do I need to fork the project, or can I push a new branch directly to this project?
Dotliquid version
5.5.0
Expected behavior
include
with awith
operator should not be iterating IEnumerable objects. Thefor
operator is for iterating the template for each item in an IEnumerable, but thewith
operator is only supposed to pass the variable to the included template. It was added because liquid was unable to pass variables that had the same name as the template itself.Actual behavior
The
with
operator acts just likefor
. This is particularly problematic, when a string is passed, because of a second issue: DotLiquid treats strings as arrays of characters (because they implement IEnumerable), resulting in the included template being rendered once for each character in the string.I have fixed both of these issued and would like to make a pull request. Do I need to fork the project, or can I push a new branch directly to this project?