File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1290,7 +1290,8 @@ module.exports = function (Twig) {
12901290 that . parent = ext_template ;
12911291
12921292 return that . parent . renderAsync ( that . context , {
1293- blocks : that . blocks
1293+ blocks : that . blocks ,
1294+ isInclude : true
12941295 } ) ;
12951296 }
12961297
Original file line number Diff line number Diff line change @@ -382,6 +382,16 @@ describe("Twig.js Core ->", function() {
382382 } ) . render ( { value : "&" } ) . should . equal ( '&& & & & &&' ) ;
383383 } ) ;
384384
385+ it ( "should not autoescape includes having a parent" , function ( ) {
386+ twig ( { id : 'included3' , data : '{% extends "parent2" %}{% block body %}& {{ value }} &{% endblock %}' } ) ;
387+ twig ( { id : 'parent2' , data : '&& {% block body %}{% endblock body %} &&' } ) ;
388+ twig ( {
389+ allowInlineIncludes : true ,
390+ autoescape : true ,
391+ data : '&&& {% include "included3" %} &&&'
392+ } ) . render ( { value : "&" } ) . should . equal ( '&&& && & & & && &&&' ) ;
393+ } ) ;
394+
385395 it ( "should support autoescape option with alternative strategy" , function ( ) {
386396 twig ( {
387397 autoescape : 'js' ,
You can’t perform that action at this time.
0 commit comments