Switch to The PHP League’s autolink extension

This commit is contained in:
Jonny Barnes 2019-03-17 16:32:00 +00:00
parent 4de57bbf2d
commit 7cd8def105
3 changed files with 61 additions and 50 deletions

View file

@ -19,8 +19,8 @@ use App\Exceptions\TwitterContentException;
use Illuminate\Database\Eloquent\SoftDeletes;
use League\CommonMark\Block\Element\FencedCode;
use League\CommonMark\Block\Element\IndentedCode;
use Jonnybarnes\CommonmarkLinkify\LinkifyExtension;
use Spatie\CommonMarkHighlighter\FencedCodeRenderer;
use League\CommonMark\Ext\Autolink\AutolinkExtension;
use Spatie\CommonMarkHighlighter\IndentedCodeRenderer;
class Note extends Model
@ -514,7 +514,7 @@ class Note extends Model
private function convertMarkdown(string $note): string
{
$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new LinkifyExtension());
$environment->addExtension(new AutolinkExtension());
$environment->addBlockRenderer(FencedCode::class, new FencedCodeRenderer());
$environment->addBlockRenderer(IndentedCode::class, new IndentedCodeRenderer());
$converter = new CommonMarkConverter([], $environment);