You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I've been playing around with Djangode and ran into a problem. The template system is removing lone % characters. After a bit of searching I found that on line 38 of template.js the regexp:
/(?:{{|}}|{%|%})|[{}|]|[^{}%|]+/g
is removing, or ignoring, them. Now, I'm not sure if it's deliberately like that or not (although I don't remember % characters being an issue when working with Django templates). I think the fix is:
/(?:{{|}}|{%|%})|[{}%|]|[^{}%|]+/g
...but I'm not sure what I might be breaking by doing this, because I'll admit I don't fully understand all that is happening in the tokenizer/parser. I've run a few rudimentary tests and this change hasn't caused any problems.
Cheers!
Stephen.
The text was updated successfully, but these errors were encountered:
All the tests still parse with the changed regex, so it looks like it works. I added the change to in change in my branch together with a test against the '%' bug.
Hi. I've been playing around with Djangode and ran into a problem. The template system is removing lone % characters. After a bit of searching I found that on line 38 of template.js the regexp:
/(?:{{|}}|{%|%})|[{}|]|[^{}%|]+/g
is removing, or ignoring, them. Now, I'm not sure if it's deliberately like that or not (although I don't remember % characters being an issue when working with Django templates). I think the fix is:
/(?:{{|}}|{%|%})|[{}%|]|[^{}%|]+/g
...but I'm not sure what I might be breaking by doing this, because I'll admit I don't fully understand all that is happening in the tokenizer/parser. I've run a few rudimentary tests and this change hasn't caused any problems.
Cheers!
Stephen.
The text was updated successfully, but these errors were encountered: