Skip to content

Commit 4fcf3c1

Browse files
committed
Add twigAutoescape config setting
1 parent 3e28821 commit 4fcf3c1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"lineageMatchKey": 2,
3636
"patternExtension": "twig",
3737
"twigDebug": false,
38+
"twigAutoescape": "html",
3839
"twigDefaultDateFormat": "",
3940
"twigDefaultIntervalFormat": "",
4041
"twigMacroExt": "macro.twig",
@@ -45,4 +46,4 @@
4546
}
4647
}
4748
}
48-
}
49+
}

src/PatternLab/PatternEngine/Twig/Loaders/PatternLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function __construct($options = array()) {
2828

2929
// set-up default vars
3030
$twigDebug = Config::getOption("twigDebug");
31+
$twigAutoescape = Config::getOption("twigAutoescape");
3132

3233
// set-up the loader list
3334
$loaders = array();
@@ -56,7 +57,7 @@ public function __construct($options = array()) {
5657

5758
// set-up Twig
5859
$twigLoader = new \Twig_Loader_Chain($loaders);
59-
$this->instance = new \Twig_Environment($twigLoader, array("debug" => $twigDebug));
60+
$this->instance = new \Twig_Environment($twigLoader, array("debug" => $twigDebug, "autoescape" => $twigAutoescape));
6061

6162
// customize Twig
6263
$this->instance = TwigUtil::loadFilters($this->instance);

0 commit comments

Comments
 (0)