aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/league/html-to-markdown/src/Converter
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-12-18 15:48:49 +0100
committerMario Vavti <mario@mariovavti.com>2017-12-18 15:48:49 +0100
commit439d41b194073285ab97be94253b3f4cb4395e43 (patch)
tree272d4c64ea2d766235ecb41009117b5269f8cdfd /vendor/league/html-to-markdown/src/Converter
parent08a8f195e749a120642f6c486c1dad62a73924d1 (diff)
downloadvolse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.gz
volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.bz2
volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.zip
install smarty via composer and update other php libs
Diffstat (limited to 'vendor/league/html-to-markdown/src/Converter')
-rw-r--r--vendor/league/html-to-markdown/src/Converter/ListItemConverter.php26
-rw-r--r--vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php3
2 files changed, 25 insertions, 4 deletions
diff --git a/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php b/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php
index dafec077c..f737b4e19 100644
--- a/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php
+++ b/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php
@@ -2,11 +2,26 @@
namespace League\HTMLToMarkdown\Converter;
+use League\HTMLToMarkdown\Configuration;
+use League\HTMLToMarkdown\ConfigurationAwareInterface;
use League\HTMLToMarkdown\ElementInterface;
-class ListItemConverter implements ConverterInterface
+class ListItemConverter implements ConverterInterface, ConfigurationAwareInterface
{
/**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @param Configuration $config
+ */
+ public function setConfig(Configuration $config)
+ {
+ $this->config = $config;
+ }
+
+ /**
* @param ElementInterface $element
*
* @return string
@@ -29,10 +44,15 @@ class ListItemConverter implements ConverterInterface
}
if ($list_type === 'ul') {
- return $prefix . '- ' . $value . "\n";
+ $list_item_style = $this->config->getOption('list_item_style', '-');
+ return $prefix . $list_item_style . ' ' . $value . "\n";
}
- $number = $element->getSiblingPosition();
+ if ($list_type === 'ol' && $start = $element->getParent()->getAttribute('start')) {
+ $number = $start + $element->getSiblingPosition() - 1;
+ } else {
+ $number = $element->getSiblingPosition();
+ }
return $prefix . $number . '. ' . $value . "\n";
}
diff --git a/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php b/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php
index cf852bfcf..7207b81a6 100644
--- a/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php
+++ b/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php
@@ -109,7 +109,8 @@ class ParagraphConverter implements ConverterInterface
{
$regExs = array(
// Match numbers ending on ')' or '.' that are at the beginning of the line.
- '/^[0-9]+(?=\)|\.)/'
+ // They will be escaped if immediately followed by a space or newline.
+ '/^[0-9]+(?=(\)|\.)( |$))/'
);
foreach ($regExs as $i) {