Skip to content

Commit

Permalink
Merge pull request #44 from prajapati-kaushik/0000-add-markdown-comon…
Browse files Browse the repository at this point in the history
…mark-attributes-extension

chore: commonmark attribute extension #0000
  • Loading branch information
prajapati-kaushik authored Dec 11, 2024
2 parents 5579528 + 09a7e22 commit 0f0f4ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Services/WikiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use CzProject\GitPhp\Git;
use Doctrine\ORM\EntityManagerInterface;
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Extension\Attributes\AttributesExtension;
use League\CommonMark\Extension\Table\TableExtension;
use LinkORB\Bundle\WikiBundle\Entity\Wiki;
use LinkORB\Bundle\WikiBundle\Entity\WikiPage;
Expand All @@ -30,7 +31,7 @@ public function __construct(
EntityManagerInterface $em,
WikiEventService $wikiEventService,
AuthorizationCheckerInterface $authorizationChecker,
private ParameterBagInterface $params
private ParameterBagInterface $params,
) {
$this->wikiRepository = $wikiRepository;
$this->wikiPageRepository = $wikiPageRepository;
Expand Down Expand Up @@ -295,6 +296,7 @@ public function markdownToHtml(Wiki $wiki, ?string $markdown): ?string

$environment = $converter->getEnvironment();
$environment->addExtension(new TableExtension());
$environment->addExtension(new AttributesExtension());

$html = $converter->convert($markdown ?? '');

Expand Down

0 comments on commit 0f0f4ca

Please sign in to comment.