BookStackApp/BookStack

View on GitHub
app/Entities/Tools/Markdown/CustomStrikeThroughExtension.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace BookStack\Entities\Tools\Markdown;

use League\CommonMark\Environment\EnvironmentBuilderInterface;
use League\CommonMark\Extension\ExtensionInterface;
use League\CommonMark\Extension\Strikethrough\Strikethrough;
use League\CommonMark\Extension\Strikethrough\StrikethroughDelimiterProcessor;

class CustomStrikeThroughExtension implements ExtensionInterface
{
    public function register(EnvironmentBuilderInterface $environment): void
    {
        $environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor());
        $environment->addRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
    }
}