From 7c0e65fe650addf13fcc5c847b5c8949b5db161a Mon Sep 17 00:00:00 2001 From: Alex Rock Ancelet Date: Tue, 24 Sep 2024 20:07:21 +0200 Subject: [PATCH] Add ability to customize options injected into LeagueCommonMarkConverterFactory --- LeagueCommonMarkConverterFactory.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LeagueCommonMarkConverterFactory.php b/LeagueCommonMarkConverterFactory.php index a2b90a2..10247d1 100644 --- a/LeagueCommonMarkConverterFactory.php +++ b/LeagueCommonMarkConverterFactory.php @@ -20,18 +20,20 @@ final class LeagueCommonMarkConverterFactory { private $extensions; + private $converterConfig; /** * @param ExtensionInterface[] $extensions */ - public function __construct(iterable $extensions) + public function __construct(iterable $extensions, array $converterConfig = []) { $this->extensions = $extensions; + $this->converterConfig = $converterConfig; } public function __invoke(): CommonMarkConverter { - $converter = new CommonMarkConverter(); + $converter = new CommonMarkConverter($this->converterConfig); foreach ($this->extensions as $extension) { $converter->getEnvironment()->addExtension($extension);