2021-06-26 11:23:15 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\Entities\Tools\Markdown;
|
2021-01-10 18:01:11 -05:00
|
|
|
|
2023-02-06 15:00:44 -05:00
|
|
|
use League\CommonMark\Environment\EnvironmentBuilderInterface;
|
2021-01-10 18:01:11 -05:00
|
|
|
use League\CommonMark\Extension\ExtensionInterface;
|
|
|
|
use League\CommonMark\Extension\Strikethrough\Strikethrough;
|
|
|
|
use League\CommonMark\Extension\Strikethrough\StrikethroughDelimiterProcessor;
|
|
|
|
|
|
|
|
class CustomStrikeThroughExtension implements ExtensionInterface
|
|
|
|
{
|
2023-02-06 15:00:44 -05:00
|
|
|
public function register(EnvironmentBuilderInterface $environment): void
|
2021-01-10 18:01:11 -05:00
|
|
|
{
|
|
|
|
$environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor());
|
2023-02-06 15:00:44 -05:00
|
|
|
$environment->addRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
|
2021-01-10 18:01:11 -05:00
|
|
|
}
|
2021-03-07 17:24:05 -05:00
|
|
|
}
|