Skip to content

Commit

Permalink
Merge pull request #13 from leviy/enable-autoescape-by-default
Browse files Browse the repository at this point in the history
Enable automatic escaping of html for TwigJS template parameters
  • Loading branch information
denniscoorn authored Feb 4, 2021
2 parents 5302cf1 + 181fdb4 commit 9996d07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ module.exports = new Config().defaults({
loader: 'twigjs-loader',
options: {
renderTemplate(twigData, dependencies) {
twigData.autoescape = true;

return `
${dependencies}
var twig = require('${path.resolve(process.cwd(), 'node_modules/twig')}').twig;
Expand Down

0 comments on commit 9996d07

Please sign in to comment.