From 0f5fe1afb012d91746e4f807864da1fa35dd69cd Mon Sep 17 00:00:00 2001
From: Ere Maijala <ere.maijala@helsinki.fi>
Date: Tue, 3 Mar 2020 15:22:14 +0200
Subject: [PATCH] Use requested name in MarkdownFactory. (#1569)

This allows the factory to create also subclasses of the Markdown class.
---
 module/VuFind/src/VuFind/View/Helper/Root/MarkdownFactory.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/VuFind/src/VuFind/View/Helper/Root/MarkdownFactory.php b/module/VuFind/src/VuFind/View/Helper/Root/MarkdownFactory.php
index 2bc862ec476..a92819c7a3a 100644
--- a/module/VuFind/src/VuFind/View/Helper/Root/MarkdownFactory.php
+++ b/module/VuFind/src/VuFind/View/Helper/Root/MarkdownFactory.php
@@ -57,6 +57,6 @@ class MarkdownFactory implements FactoryInterface
         ContainerInterface $container, $requestedName, array $options = null
     ) {
         $markdownService = $container->get('League\CommonMark\ConverterInterface');
-        return new Markdown($markdownService);
+        return new $requestedName($markdownService);
     }
 }
-- 
GitLab