From 479336e09f4dee7a273d37422eca586de0bc2abc Mon Sep 17 00:00:00 2001 From: noniagriconomie Date: Tue, 6 Jul 2021 20:36:44 +0200 Subject: [PATCH] Update Markdown packages --- doc/filters/html_to_markdown.rst | 4 ++-- extra/markdown-extra/DefaultMarkdown.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/filters/html_to_markdown.rst b/doc/filters/html_to_markdown.rst index 66706e92d..cb4f631a4 100644 --- a/doc/filters/html_to_markdown.rst +++ b/doc/filters/html_to_markdown.rst @@ -61,9 +61,9 @@ You can also use the filter on an entire template which you ``include``: ``html_to_markdown`` is just a frontend; the actual conversion is done by one of the following compatible libraries, from which you can choose: -* `erusev/parsedown`_ * `league/html-to-markdown`_ * `michelf/php-markdown`_ +* `erusev/parsedown`_ Depending on the library, you can also add some options by passing them as an argument to the filter. Example for ``league/html-to-markdown``: @@ -76,6 +76,6 @@ to the filter. Example for ``league/html-to-markdown``: {% endapply %} -.. _erusev/parsedown: https://github.com/erusev/parsedown .. _league/html-to-markdown: https://github.com/thephpleague/html-to-markdown .. _michelf/php-markdown: https://github.com/michelf/php-markdown +.. _erusev/parsedown: https://github.com/erusev/parsedown diff --git a/extra/markdown-extra/DefaultMarkdown.php b/extra/markdown-extra/DefaultMarkdown.php index 24aad2e34..9059f6c7f 100644 --- a/extra/markdown-extra/DefaultMarkdown.php +++ b/extra/markdown-extra/DefaultMarkdown.php @@ -21,14 +21,14 @@ class DefaultMarkdown implements MarkdownInterface public function __construct() { - if (class_exists(Parsedown::class)) { - $this->converter = new ErusevMarkdown(); - } elseif (class_exists(CommonMarkConverter::class)) { + if (class_exists(CommonMarkConverter::class)) { $this->converter = new LeagueMarkdown(); } elseif (class_exists(MarkdownExtra::class)) { $this->converter = new MichelfMarkdown(); + } elseif (class_exists(Parsedown::class)) { + $this->converter = new ErusevMarkdown(); } else { - throw new \LogicException('You cannot use the "markdown_to_html" filter as no Markdown library is available; try running "composer require erusev/parsedown".'); + throw new \LogicException('You cannot use the "markdown_to_html" filter as no Markdown library is available; try running "composer require league/html-to-markdown".'); } }