minor #3547 Update Markdown packages (noniagriconomie)

This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.

Discussion
----------

Update Markdown packages

Hi,

Small PR to update the order of markdown packages related to their recent activities and releases :)
Feel free to close, cheers

Commits
-------

479336e0 Update Markdown packages
This commit is contained in:
Fabien Potencier
2021-07-07 09:07:54 +02:00
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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``:
</html>
{% 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
+4 -4
View File
@@ -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".');
}
}