Update Markdown packages

This commit is contained in:
noniagriconomie
2021-07-06 20:36:44 +02:00
committed by Fabien Potencier
parent 7926399e0a
commit 479336e09f
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".');
}
}