diff --git a/flexiapi/app/Helpers/Utils.php b/flexiapi/app/Helpers/Utils.php index 55c0e06..7333e94 100644 --- a/flexiapi/app/Helpers/Utils.php +++ b/flexiapi/app/Helpers/Utils.php @@ -23,10 +23,9 @@ use App\Account; use App\DigestNonce; use App\ExternalAccount; use Illuminate\Support\Facades\Schema; -use League\CommonMark\Environment; +use League\CommonMark\CommonMarkConverter; use League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension; use League\CommonMark\Extension\TableOfContents\TableOfContentsExtension; -use League\CommonMark\MarkdownConverter; function generateNonce(): string { @@ -63,10 +62,7 @@ function percent($value, $max) function markdownDocumentationView($view): string { - $environment = Environment::createCommonMarkEnvironment(); - $environment->addExtension(new HeadingPermalinkExtension); - $environment->addExtension(new TableOfContentsExtension); - $environment->mergeConfig([ + $converter = new CommonMarkConverter([ 'heading_permalink' => [ 'html_class' => 'permalink', 'insert' => 'after', @@ -79,10 +75,11 @@ function markdownDocumentationView($view): string ], ]); - $converter = new MarkdownConverter($environment); + $converter->getEnvironment()->addExtension(new HeadingPermalinkExtension); + $converter->getEnvironment()->addExtension(new TableOfContentsExtension); - return (string) $converter->convertToHtml( - view($view, [ + return (string) $converter->convert( + (string)view($view, [ 'app_name' => config('app.name') ])->render() ); diff --git a/flexiapi/composer.lock b/flexiapi/composer.lock index 65fdcab..34ad491 100644 --- a/flexiapi/composer.lock +++ b/flexiapi/composer.lock @@ -7982,16 +7982,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.21", + "version": "9.2.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", "shasum": "" }, "require": { @@ -8047,7 +8047,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" }, "funding": [ { @@ -8055,7 +8055,7 @@ "type": "github" } ], - "time": "2022-12-14T13:26:54+00:00" + "time": "2022-12-18T16:40:55+00:00" }, { "name": "phpunit/php-file-iterator",