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/BlockquoteConverter.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/BlockquoteConverter.php')
-rw-r--r-- | vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php b/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php index eb2d09d17..65034db12 100644 --- a/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php @@ -1,32 +1,30 @@ <?php +declare(strict_types=1); + namespace League\HTMLToMarkdown\Converter; use League\HTMLToMarkdown\ElementInterface; class BlockquoteConverter implements ConverterInterface { - /** - * @param ElementInterface $element - * - * @return string - */ - public function convert(ElementInterface $element) + public function convert(ElementInterface $element): string { // Contents should have already been converted to Markdown by this point, // so we just need to add '>' symbols to each line. $markdown = ''; - $quote_content = trim($element->getValue()); + $quoteContent = \trim($element->getValue()); - $lines = preg_split('/\r\n|\r|\n/', $quote_content); + $lines = \preg_split('/\r\n|\r|\n/', $quoteContent); + \assert(\is_array($lines)); - $total_lines = count($lines); + $totalLines = \count($lines); foreach ($lines as $i => $line) { $markdown .= '> ' . $line . "\n"; - if ($i + 1 === $total_lines) { + if ($i + 1 === $totalLines) { $markdown .= "\n"; } } @@ -37,8 +35,8 @@ class BlockquoteConverter implements ConverterInterface /** * @return string[] */ - public function getSupportedTags() + public function getSupportedTags(): array { - return array('blockquote'); + return ['blockquote']; } } |