diff options
author | Mario Vavti <mario@mariovavti.com> | 2020-08-22 19:56:28 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2020-08-22 19:56:28 +0200 |
commit | 88a68f96da303893d911f09c25088d4f8288b5fb (patch) | |
tree | 65bc81e92f02cbf253c5ab2d92e9c3f2bd2cb39e /vendor/league/html-to-markdown/README.md | |
parent | 32bdf42913518b3421986cb4d49d62ed1b04354e (diff) | |
download | volse-hubzilla-88a68f96da303893d911f09c25088d4f8288b5fb.tar.gz volse-hubzilla-88a68f96da303893d911f09c25088d4f8288b5fb.tar.bz2 volse-hubzilla-88a68f96da303893d911f09c25088d4f8288b5fb.zip |
composer update html-to-markdown
Diffstat (limited to 'vendor/league/html-to-markdown/README.md')
-rw-r--r-- | vendor/league/html-to-markdown/README.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/league/html-to-markdown/README.md b/vendor/league/html-to-markdown/README.md index c7ae2dcab..c1ac805ab 100644 --- a/vendor/league/html-to-markdown/README.md +++ b/vendor/league/html-to-markdown/README.md @@ -141,6 +141,21 @@ $converter->getConfig()->setOption('hard_break', false); // default $markdown = $converter->convert($html); // $markdown now contains "test \nline break" ``` +### Autolinking options + +By default, `a` tags are converted to the easiest possible link syntax, i.e. if no text or title is available, then the `<url>` syntax will be used rather than the full `[url](url)` syntax. Set `use_autolinks` to `false` to change this behavior to always use the full link syntax. + +```php +$converter = new HtmlConverter(); +$html = '<p><a href="https://thephpleague.com">https://thephpleague.com</a></p>'; + +$converter->getConfig()->setOption('use_autolinks', true); +$markdown = $converter->convert($html); // $markdown now contains "<https://thephpleague.com>" + +$converter->getConfig()->setOption('use_autolinks', false); // default +$markdown = $converter->convert($html); // $markdown now contains "[https://google.com](https://google.com)" +``` + ### Passing custom Environment object You can pass current `Environment` object to customize i.e. which converters should be used. |