markdown = $markdown; } public function convert(): string { $environment = new Environment(); $environment->addExtension(new CommonMarkCoreExtension()); $environment->addExtension(new TableExtension()); $environment->addExtension(new TaskListExtension()); $environment->addExtension(new CustomStrikeThroughExtension()); $environment = Theme::dispatch(ThemeEvents::COMMONMARK_ENVIRONMENT_CONFIGURE, $environment) ?? $environment; $converter = new MarkdownConverter($environment); $environment->addRenderer(ListItem::class, new CustomListItemRenderer(), 10); return $converter->convert($this->markdown)->getContent(); } }