]> BookStack Code Mirror - bookstack/blob - app/Entities/Tools/Markdown/CustomStrikeThroughExtension.php
respective book and chapter structure added.
[bookstack] / app / Entities / Tools / Markdown / CustomStrikeThroughExtension.php
1 <?php
2
3 namespace BookStack\Entities\Tools\Markdown;
4
5 use League\CommonMark\Environment\EnvironmentBuilderInterface;
6 use League\CommonMark\Extension\ExtensionInterface;
7 use League\CommonMark\Extension\Strikethrough\Strikethrough;
8 use League\CommonMark\Extension\Strikethrough\StrikethroughDelimiterProcessor;
9
10 class CustomStrikeThroughExtension implements ExtensionInterface
11 {
12     public function register(EnvironmentBuilderInterface $environment): void
13     {
14         $environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor());
15         $environment->addRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
16     }
17 }