mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 12:06:56 +00:00
Update Markdown packages
This commit is contained in:
committed by
Fabien Potencier
parent
7926399e0a
commit
479336e09f
@@ -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
|
||||
|
||||
@@ -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".');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user