Closed conartist6 closed 2 years ago
This will also fix some unreported weird issues the current implementation has since it is possible to double-interpolate, i.e. the failing case is:
pupa('{{key}}', {key: '{x}'});
That will blow up because x
is missing in data
because pupa treats {x}
as part of the template expression which it is not.
Thanks for working on this. I agree, this is a better solution.
Would you be able to add more tests? Especially, for invalid input, to ensure there are no security vulnerabilities or obvious bugs in the parsing.
This will also fix some unreported weird issues the current implementation has since it is possible to double-interpolate, i.e. the failing case is:
Would you be able to add a test for that?
I really appreciate you sharing this. However, I don't have the time to do the required changes to make this mergable.
Some previously parseable templates will now be errors We are now much more permissive about possible keys Introduced support for escaping
As noted above this is breaking and would be prudent to release as a new major version.