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) {
1290
1290
that . parent = ext_template ;
1291
1291
1292
1292
return that . parent . renderAsync ( that . context , {
1293
- blocks : that . blocks
1293
+ blocks : that . blocks ,
1294
+ isInclude : true
1294
1295
} ) ;
1295
1296
}
1296
1297
Original file line number Diff line number Diff line change @@ -382,6 +382,16 @@ describe("Twig.js Core ->", function() {
382
382
} ) . render ( { value : "&" } ) . should . equal ( '&& & & & &&' ) ;
383
383
} ) ;
384
384
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
+
385
395
it ( "should support autoescape option with alternative strategy" , function ( ) {
386
396
twig ( {
387
397
autoescape : 'js' ,
You can’t perform that action at this time.
0 commit comments