Switch to The PHP League’s autolink extension
This commit is contained in:
parent
4de57bbf2d
commit
7cd8def105
3 changed files with 61 additions and 50 deletions
|
@ -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);
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
"guzzlehttp/guzzle": "~6.0",
|
||||
"indieauth/client": "~0.1",
|
||||
"intervention/image": "^2.4",
|
||||
"jonnybarnes/commonmark-linkify": "^0.5",
|
||||
"jonnybarnes/emoji-a11y": "^0.3",
|
||||
"jonnybarnes/indieweb": "dev-master",
|
||||
"jonnybarnes/webmentions-parser": "0.4.*",
|
||||
|
@ -25,6 +24,7 @@
|
|||
"laravel/tinker": "^1.0",
|
||||
"lcobucci/jwt": "^3.1",
|
||||
"league/commonmark": "^0.18.0",
|
||||
"league/commonmark-ext-autolink": "^0.2.0",
|
||||
"league/flysystem-aws-s3-v3": "^1.0",
|
||||
"mf2/mf2": "~0.3",
|
||||
"phaza/laravel-postgis": "~3.1",
|
||||
|
|
105
composer.lock
generated
105
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "2337f94b0e6c7d9f3589283c1204c053",
|
||||
"content-hash": "bdc34ba06abc541ce11bcc51b6034c24",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
|
@ -1595,52 +1595,6 @@
|
|||
],
|
||||
"time": "2015-09-27T15:35:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jonnybarnes/commonmark-linkify",
|
||||
"version": "v0.5.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jonnybarnes/commonmark-linkify.git",
|
||||
"reference": "e27103f5e0e9e84eb17344a361845241e27512e0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jonnybarnes/commonmark-linkify/zipball/e27103f5e0e9e84eb17344a361845241e27512e0",
|
||||
"reference": "e27103f5e0e9e84eb17344a361845241e27512e0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"league/commonmark": "^0.18.0",
|
||||
"php": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Jonnybarnes\\CommonmarkLinkify\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"CC0-1.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jonny Barnes",
|
||||
"email": "jonny@jonnybarnes.uk"
|
||||
}
|
||||
],
|
||||
"description": "Turn plaintext URLs into click-able links",
|
||||
"homepage": "https://github.com/jonnybarnes/commonmark-linkify",
|
||||
"keywords": [
|
||||
"commonmark",
|
||||
"extension",
|
||||
"markdown"
|
||||
],
|
||||
"time": "2019-02-17T10:48:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jonnybarnes/emoji-a11y",
|
||||
"version": "v0.3",
|
||||
|
@ -2246,6 +2200,63 @@
|
|||
],
|
||||
"time": "2019-03-17T01:41:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/commonmark-ext-autolink",
|
||||
"version": "v0.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/commonmark-ext-autolink.git",
|
||||
"reference": "585875f1531bbe6efd77ab480ee61ef2957137b3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark-ext-autolink/zipball/585875f1531bbe6efd77ab480ee61ef2957137b3",
|
||||
"reference": "585875f1531bbe6efd77ab480ee61ef2957137b3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"league/commonmark": "^0.18.2",
|
||||
"php": "^5.6||^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.7.27"
|
||||
},
|
||||
"type": "commonmark-extension",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.3-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"League\\CommonMark\\Ext\\Autolink\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Colin O'Dell",
|
||||
"email": "colinodell@gmail.com",
|
||||
"homepage": "https://www.colinodell.com",
|
||||
"role": "Lead Developer"
|
||||
}
|
||||
],
|
||||
"description": "Extension for league/commonmark which autolinks URLs, emails, and @-mentions",
|
||||
"homepage": "https://github.com/thephpleague/commonmark-ext-autolink",
|
||||
"keywords": [
|
||||
"autolink",
|
||||
"commonmark",
|
||||
"extension",
|
||||
"gfm",
|
||||
"github",
|
||||
"markdown",
|
||||
"twitter"
|
||||
],
|
||||
"time": "2019-03-17T03:06:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem",
|
||||
"version": "1.0.50",
|
||||
|
|
Loading…
Add table
Reference in a new issue