Skip to content

Commit 8fdb11d

Browse files
committed
fix: #61 markdown multi empty line
1 parent 0add0da commit 8fdb11d

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

app/Confluence.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public function htmlFile2Markdown(string $filename): string
6767
$element->parentNode->removeChild($element);
6868
}
6969
$html = $this->document->saveHTML($contentElement);
70-
return $this->htmlConverter->convert($html);
70+
$markdown = $this->htmlConverter->convert($html);
71+
$markdown = preg_replace("/[ ]*\n/s", "\n", $markdown);
72+
return preg_replace("/\n\n\n/s", "\n", $markdown);
7173
}
7274

7375
/**
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
hello
22
=====
33

4-
5-
6-
7-
84
Hello World!
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
hello
22
=====
33

4-
5-
64
Hello World!

0 commit comments

Comments
 (0)