public function preProcessSource($templateSource)
{
$matches = [];
preg_match_all(self::$SCAN_PATTERN_ESCAPINGMODIFIER, $templateSource, $matches, PREG_SET_ORDER);
if ($matches === []) {
return $templateSource;
}
if (count($matches) > 1) {
throw new Exception('There is more than one escaping modifier defined. There can only be one {escapingEnabled=...} per template.', 1407331080);
}
if (strtolower($matches[0]['enabled']) === 'false') {
$this->renderingContext->getTemplateParser()->setEscapingEnabled(false);
}
$templateSource = preg_replace(self::$SCAN_PATTERN_ESCAPINGMODIFIER, '', $templateSource);
return $templateSource;
}