aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php')
-rw-r--r--vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php b/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php
index 37cd44e73..d079d9127 100644
--- a/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php
+++ b/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php
@@ -28,7 +28,19 @@ class HardBreakConverter implements ConverterInterface, ConfigurationAwareInterf
*/
public function convert(ElementInterface $element)
{
- return $this->config->getOption('hard_break') ? "\n" : " \n";
+ $return = $this->config->getOption('hard_break') ? "\n" : " \n";
+
+ $next = $element->getNext();
+ if ($next) {
+ $next_value = $next->getValue();
+ if ($next_value) {
+ if (in_array(substr($next_value, 0, 2), array('- ', '* ', '+ '))) {
+ $return .= '\\';
+ }
+ }
+ }
+
+ return $return;
}
/**