diff options
author | nobody <nobody@zotlabs.com> | 2021-06-17 14:57:47 -0700 |
---|---|---|
committer | nobody <nobody@zotlabs.com> | 2021-06-17 14:57:47 -0700 |
commit | efda8aac1d7d90fd7eda4a449332eedf74342951 (patch) | |
tree | 3373c0579168776cccda5224b6b33ce59fa9b274 /vendor/league/html-to-markdown/src/Converter/DefaultConverter.php | |
parent | 686530c1873f98d724355bf3f456243b1b7fdadd (diff) | |
parent | a84cec4acddf6804a88fcda52e4437c91785dfb2 (diff) | |
download | volse-hubzilla-efda8aac1d7d90fd7eda4a449332eedf74342951.tar.gz volse-hubzilla-efda8aac1d7d90fd7eda4a449332eedf74342951.tar.bz2 volse-hubzilla-efda8aac1d7d90fd7eda4a449332eedf74342951.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'vendor/league/html-to-markdown/src/Converter/DefaultConverter.php')
-rw-r--r-- | vendor/league/html-to-markdown/src/Converter/DefaultConverter.php | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php b/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php index 8de0af210..e71dd10cc 100644 --- a/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace League\HTMLToMarkdown\Converter; use League\HTMLToMarkdown\Configuration; @@ -8,27 +10,17 @@ use League\HTMLToMarkdown\ElementInterface; class DefaultConverter implements ConverterInterface, ConfigurationAwareInterface { - const DEFAULT_CONVERTER = '_default'; + public const DEFAULT_CONVERTER = '_default'; - /** - * @var Configuration - */ + /** @var Configuration */ protected $config; - /** - * @param Configuration $config - */ - public function setConfig(Configuration $config) + public function setConfig(Configuration $config): void { $this->config = $config; } - /** - * @param ElementInterface $element - * - * @return string - */ - public function convert(ElementInterface $element) + public function convert(ElementInterface $element): string { // If strip_tags is false (the default), preserve tags that don't have Markdown equivalents, // such as <span> nodes on their own. C14N() canonicalizes the node to a string. @@ -37,8 +29,9 @@ class DefaultConverter implements ConverterInterface, ConfigurationAwareInterfac return $element->getValue(); } - $markdown = html_entity_decode($element->getChildrenAsString()); + $markdown = \html_entity_decode($element->getChildrenAsString()); + // Tables are only handled here if TableConverter is not used if ($element->getTagName() === 'table') { $markdown .= "\n\n"; } @@ -49,8 +42,8 @@ class DefaultConverter implements ConverterInterface, ConfigurationAwareInterfac /** * @return string[] */ - public function getSupportedTags() + public function getSupportedTags(): array { - return array(self::DEFAULT_CONVERTER); + return [self::DEFAULT_CONVERTER]; } } |