From ca5fe639523450958f377e680cc5b35fd11281c2 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 9 May 2023 09:14:46 +0200 Subject: [PATCH] wip #5851 @0.25 --- app/Jobs/DownloadBase.php | 6 +++- app/Mail/FluidbookQuoteReceived.php | 6 +++- composer.lock | 50 ++++++++++++++--------------- 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/app/Jobs/DownloadBase.php b/app/Jobs/DownloadBase.php index d6f4dd695..28492f564 100644 --- a/app/Jobs/DownloadBase.php +++ b/app/Jobs/DownloadBase.php @@ -18,6 +18,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Mail; use JoliCode\Slack\ClientFactory; use League\CommonMark\CommonMarkConverter; +use League\CommonMark\Exception\CommonMarkException; class DownloadBase extends Base { @@ -62,6 +63,9 @@ class DownloadBase extends Base return Slack::send($this->getUser()->slack, $subject, $text, $actions); } + /** + * @throws CommonMarkException + */ public function sendEmail($subject, $text, $actions = []) { $body = ''; @@ -77,7 +81,7 @@ class DownloadBase extends Base $mail = new DeferredDownload(); $mail->to($this->user->email); $mail->subject($subject); - $mail->html($converter->convertToHtml($body)); + $mail->html($converter->convert($body)->getContent()); Mail::send($mail); } diff --git a/app/Mail/FluidbookQuoteReceived.php b/app/Mail/FluidbookQuoteReceived.php index 99bd3f6e3..dc4d136f8 100644 --- a/app/Mail/FluidbookQuoteReceived.php +++ b/app/Mail/FluidbookQuoteReceived.php @@ -4,10 +4,14 @@ namespace App\Mail; use Cubist\Locale\Country; use League\CommonMark\CommonMarkConverter; +use League\CommonMark\Exception\CommonMarkException; class FluidbookQuoteReceived extends Base { + /** + * @throws CommonMarkException + */ public function setData($post) { @@ -31,7 +35,7 @@ class FluidbookQuoteReceived extends Base } $markdown = self::getMarkdown($post, $footer); $converter = new CommonMarkConverter(); - $this->html($converter->convertToHtml($markdown)); + $this->html($converter->convert($markdown)->getContent()); } public function build() diff --git a/composer.lock b/composer.lock index b4d34f913..db287803d 100644 --- a/composer.lock +++ b/composer.lock @@ -8844,16 +8844,16 @@ }, { "name": "spatie/image", - "version": "2.2.5", + "version": "2.2.6", "source": { "type": "git", "url": "https://github.com/spatie/image.git", - "reference": "c78e2dbdbced9c1673800e5b813cc8a8127bc5ac" + "reference": "f72ca52acd77ca03b7843a0f86e2411ce90aecfc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image/zipball/c78e2dbdbced9c1673800e5b813cc8a8127bc5ac", - "reference": "c78e2dbdbced9c1673800e5b813cc8a8127bc5ac", + "url": "https://api.github.com/repos/spatie/image/zipball/f72ca52acd77ca03b7843a0f86e2411ce90aecfc", + "reference": "f72ca52acd77ca03b7843a0f86e2411ce90aecfc", "shasum": "" }, "require": { @@ -8897,7 +8897,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/image/tree/2.2.5" + "source": "https://github.com/spatie/image/tree/2.2.6" }, "funding": [ { @@ -8909,7 +8909,7 @@ "type": "github" } ], - "time": "2023-01-19T17:06:04+00:00" + "time": "2023-05-06T10:20:33+00:00" }, { "name": "spatie/image-optimizer", @@ -9536,16 +9536,16 @@ }, { "name": "spatie/laravel-translatable", - "version": "6.5.0", + "version": "6.5.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-translatable.git", - "reference": "732e46b8c664a6da6d5d14751185c1844e2b5bc1" + "reference": "b8f102492f816608d832cfe9e420da6a856312cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-translatable/zipball/732e46b8c664a6da6d5d14751185c1844e2b5bc1", - "reference": "732e46b8c664a6da6d5d14751185c1844e2b5bc1", + "url": "https://api.github.com/repos/spatie/laravel-translatable/zipball/b8f102492f816608d832cfe9e420da6a856312cf", + "reference": "b8f102492f816608d832cfe9e420da6a856312cf", "shasum": "" }, "require": { @@ -9606,7 +9606,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-translatable/issues", - "source": "https://github.com/spatie/laravel-translatable/tree/6.5.0" + "source": "https://github.com/spatie/laravel-translatable/tree/6.5.1" }, "funding": [ { @@ -9614,7 +9614,7 @@ "type": "github" } ], - "time": "2023-04-20T08:54:14+00:00" + "time": "2023-05-06T10:22:13+00:00" }, { "name": "spatie/pdf-to-image", @@ -9914,16 +9914,16 @@ }, { "name": "swayok/alternative-laravel-cache", - "version": "6.1.10", + "version": "6.1.11", "source": { "type": "git", "url": "https://github.com/swayok/alternative-laravel-cache.git", - "reference": "31df4d2e3fa9b44b5b3a063f34b0e7bd4abb4236" + "reference": "ad4b02e2cce48c4eea9d9bd5fb298904c2fd60e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swayok/alternative-laravel-cache/zipball/31df4d2e3fa9b44b5b3a063f34b0e7bd4abb4236", - "reference": "31df4d2e3fa9b44b5b3a063f34b0e7bd4abb4236", + "url": "https://api.github.com/repos/swayok/alternative-laravel-cache/zipball/ad4b02e2cce48c4eea9d9bd5fb298904c2fd60e8", + "reference": "ad4b02e2cce48c4eea9d9bd5fb298904c2fd60e8", "shasum": "" }, "require": { @@ -9978,9 +9978,9 @@ ], "support": { "issues": "https://github.com/swayok/alternative-laravel-cache/issues", - "source": "https://github.com/swayok/alternative-laravel-cache/tree/6.1.10" + "source": "https://github.com/swayok/alternative-laravel-cache/tree/6.1.11" }, - "time": "2023-03-16T10:54:40+00:00" + "time": "2023-05-08T13:23:39+00:00" }, { "name": "symfony/cache", @@ -15662,16 +15662,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -15716,7 +15716,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -15724,7 +15724,7 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-07T05:35:17+00:00" }, { "name": "sebastian/environment", @@ -16712,5 +16712,5 @@ "ext-zlib": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } -- 2.39.5