Closed satiricon closed 10 years ago
@satiricon if I remember right, there was a problem with escapeing true/false, which is why the filter was created... later on I used it in all other form types - though I can't remember now where exacly the issue occured
Then if you think it's ok I'll try and escape quotes as well in e4js and make a pull request.
@satiricon I've looked back at the code and now I remember :)
We needed an escape filter that would recognize javascript function syntax and if it was detected, simply render raw string, otherwise wrap the string in double quotes.
Eg.:
# some admingenerator geneator yaml useing form extensions
option1: "SomeString"
option2: "function(val) { return val + 1; }"
Would be rendered as:
// some js widget options
option1: "SomeString",
option2: function(val) { return val + 1; },
@satiricon I've added double quotes escapeing to the filter. It should work fine now.
The config:
If for any reason I add something like
this is "the description"
as the description in the form of any uploaded file it will cause a JavaScript error as the line 129 in form_javascripts.html.twigDoesn't correctly escapes quotes.
if I change the line to:
It works flawlessly.
Is there a reason for not using the default twig escaper?