aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-06-05 08:47:24 +0000
committerMario <mario@mariovavti.com>2021-06-05 08:47:24 +0000
commitfd8a5ff4c49fc1361f9928ea4d33e6d24d43a3a5 (patch)
tree7560147f31a273fb8f0e05476f99f1deea0e12de /vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php
parent4db384da34595adef68be6226e8b331b4d7b7f31 (diff)
downloadvolse-hubzilla-fd8a5ff4c49fc1361f9928ea4d33e6d24d43a3a5.tar.gz
volse-hubzilla-fd8a5ff4c49fc1361f9928ea4d33e6d24d43a3a5.tar.bz2
volse-hubzilla-fd8a5ff4c49fc1361f9928ea4d33e6d24d43a3a5.zip
composer update league/html-to-markdown
Diffstat (limited to 'vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php')
-rw-r--r--vendor/league/html-to-markdown/src/Converter/BlockquoteConverter.php22
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'];
}
}