$template, 'html' => <<addExtension(new MarkdownExtension()); $twig->addRuntimeLoader(new class($class) implements RuntimeLoaderInterface { private $class; public function __construct(string $class) { $this->class = $class; } public function load($c) { if (MarkdownRuntime::class === $c) { return new $c(new $this->class()); } } }); $this->assertRegExp('{'.$expected.'}m', trim($twig->render('index'))); } } public function getMarkdownTests() { return [ [<<Hello\n+

Great!

"], [<<Hello\n+

Great!

"], ["{{ include('html')|markdown_to_html }}", "

Hello

\n+

Great!

"], ]; } }