MommaWatasu / OteraEngine.jl

This package is a template engine for Julia Lang.
https://mommawatasu.github.io/OteraEngine.jl/stable
MIT License
20 stars 4 forks source link

[fix] Resolves #31 #32

Closed codigomaye closed 6 months ago

codigomaye commented 6 months ago

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 and eachindex() function to get the index of each character correctly :+1:

MommaWatasu commented 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.

MommaWatasu commented 6 months ago

This is fixed by myself. So close this PR. Thank you for your cooperation.