diff options
author | Mario <mario@mariovavti.com> | 2023-10-05 11:35:02 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-10-05 11:35:02 +0000 |
commit | 044e252d195be7fb9c523e5ab7e5f37eae7f03fd (patch) | |
tree | e8fcefdef750aee3e84e2ddb048e1e11a1c4599f /vendor/league/html-to-markdown/src/Converter | |
parent | 6920fb2793265e5c9cdcdc8325398b07f216f184 (diff) | |
download | volse-hubzilla-044e252d195be7fb9c523e5ab7e5f37eae7f03fd.tar.gz volse-hubzilla-044e252d195be7fb9c523e5ab7e5f37eae7f03fd.tar.bz2 volse-hubzilla-044e252d195be7fb9c523e5ab7e5f37eae7f03fd.zip |
composer update html to markdown
Diffstat (limited to 'vendor/league/html-to-markdown/src/Converter')
4 files changed, 9 insertions, 5 deletions
diff --git a/vendor/league/html-to-markdown/src/Converter/LinkConverter.php b/vendor/league/html-to-markdown/src/Converter/LinkConverter.php index 25a3540fe..f0ba157f8 100644 --- a/vendor/league/html-to-markdown/src/Converter/LinkConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/LinkConverter.php @@ -72,6 +72,6 @@ class LinkConverter implements ConverterInterface, ConfigurationAwareInterface private function shouldStrip(): bool { - return $this->config->getOption('strip_placeholder_links') ?? false; + return \boolval($this->config->getOption('strip_placeholder_links') ?? false); } } diff --git a/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php b/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php index 1521aad53..d71f601e1 100644 --- a/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace League\HTMLToMarkdown\Converter; +use League\HTMLToMarkdown\Coerce; use League\HTMLToMarkdown\Configuration; use League\HTMLToMarkdown\ConfigurationAwareInterface; use League\HTMLToMarkdown\ElementInterface; @@ -38,8 +39,8 @@ class ListItemConverter implements ConverterInterface, ConfigurationAwareInterfa } if ($listType === 'ul') { - $listItemStyle = $this->config->getOption('list_item_style', '-'); - $listItemStyleAlternate = $this->config->getOption('list_item_style_alternate'); + $listItemStyle = Coerce::toString($this->config->getOption('list_item_style', '-')); + $listItemStyleAlternate = Coerce::toString($this->config->getOption('list_item_style_alternate', '')); if (! isset($this->listItemStyle)) { $this->listItemStyle = $listItemStyleAlternate ?: $listItemStyle; } diff --git a/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php b/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php index 7d8ccc132..af6dd1051 100644 --- a/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/PreformattedConverter.php @@ -11,7 +11,9 @@ class PreformattedConverter implements ConverterInterface public function convert(ElementInterface $element): string { $preContent = \html_entity_decode($element->getChildrenAsString()); - $preContent = \str_replace(['<pre>', '</pre>'], '', $preContent); + $preContent = \preg_replace('/<pre\b[^>]*>/', '', $preContent); + \assert($preContent !== null); + $preContent = \str_replace('</pre>', '', $preContent); /* * Checking for the code tag. diff --git a/vendor/league/html-to-markdown/src/Converter/TableConverter.php b/vendor/league/html-to-markdown/src/Converter/TableConverter.php index 2e63e9a5b..91e718076 100644 --- a/vendor/league/html-to-markdown/src/Converter/TableConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/TableConverter.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace League\HTMLToMarkdown\Converter; +use League\HTMLToMarkdown\Coerce; use League\HTMLToMarkdown\Configuration; use League\HTMLToMarkdown\ConfigurationAwareInterface; use League\HTMLToMarkdown\ElementInterface; @@ -89,7 +90,7 @@ class TableConverter implements ConverterInterface, PreConverterInterface, Confi } $value = \str_replace("\n", ' ', $value); - $value = \str_replace('|', $this->config->getOption('table_pipe_escape') ?? '\|', $value); + $value = \str_replace('|', Coerce::toString($this->config->getOption('table_pipe_escape') ?? '\|'), $value); return '| ' . \trim($value) . ' '; case 'thead': |