From 161266d735d503a0a4903abd0b7b788e5f6c7e36 Mon Sep 17 00:00:00 2001 From: SL-Gundam Date: Sun, 4 Feb 2018 00:56:13 +0100 Subject: [PATCH 1/2] Adjust fixInlineElementSpacing to not trigger for emptyTags --- src/Converter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Converter.php b/src/Converter.php index f4b3758..7acaf94 100644 --- a/src/Converter.php +++ b/src/Converter.php @@ -1360,7 +1360,7 @@ protected function fixBlockElementSpacing() */ protected function fixInlineElementSpacing() { - if ($this->parser->isStartTag) { + if ($this->parser->isStartTag && !$this->parser->isEmptyTag) { // move spaces after the start element to before the element if (preg_match('~^(\s+)~', $this->parser->html, $matches)) { $this->out($matches[1]); From 460c512653c31da30bc2792f045644949b876fcd Mon Sep 17 00:00:00 2001 From: SL-Gundam Date: Sun, 4 Feb 2018 02:53:43 +0100 Subject: [PATCH 2/2] Adjusted test case for this commit d0da9e0fae21d160bef3e6c16dbfd5d0fe7049b9 --- test/ConverterTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ConverterTestCase.php b/test/ConverterTestCase.php index f0ed30f..05580fd 100644 --- a/test/ConverterTestCase.php +++ b/test/ConverterTestCase.php @@ -486,7 +486,7 @@ public function providerFixBreaks() $data['break1']['html'] = "Hello,
How are you doing?
"; $data['break1']['md'] = "**Hello, \nHow are you doing?**"; $data['break2']['html'] = "Hey,
How you're doing?


Sorry

You can't get through
"; - $data['break2']['md'] = "**Hey, \nHow you're doing?** \n \n**Sorry \n \nYou can't get through**"; + $data['break2']['md'] = "**Hey, \nHow you're doing?** \n \n**Sorry \n \nYou can't get through**"; return $data; }