public function includeFiles($document)
{
$environment = $this->getEnvironment();
$parser = $this;
return preg_replace_callback('/^\\.\\. include:: (.+)$/m', function ($match) use($parser, $environment) {
$path = $environment->absoluteRelativePath($match[1]);
if ($parser->includeFileAllowed($path)) {
return $parser->includeFiles(file_get_contents($path));
} else {
return '';
}
}, $document);
}