Closed codigomaye closed 6 months ago
I checked your change. I think for
loop works in most cases, but it fails to parse when a template using +
token with the control block.
So, I will decide whether merge this PR or not(and implement by myself) after I try some test.
This is fixed by myself. So close this PR. Thank you for your cooperation.
As explained in #31, using the length of a string to get a character's index don't work with character of other languages such as Spanish. Because this scenario only works with 1-byte characters (English alphabet).
So, OteraEngine returns an error when rendering templates that have 2-byte characters, such é or ñ (In spanish).
Solution:
Replace the while loop +
lenght()
with a for loop andeachindex()
function to get the index of each character correctly :+1: