From 9816507a75b27b61035671cd2fc6f524a9b4c25c Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Wed, 19 Nov 2014 20:18:42 +0200 Subject: [PATCH] markup should preserve empty lines --- Parsedown.php | 7 +++++++ test/data/sparse_html.html | 8 ++++++++ test/data/sparse_html.md | 8 ++++++++ 3 files changed, 23 insertions(+) create mode 100644 test/data/sparse_html.html create mode 100644 test/data/sparse_html.md diff --git a/Parsedown.php b/Parsedown.php index 9aebef5..2cbf3f2 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -687,6 +687,13 @@ class Parsedown } } + if (isset($Block['interrupted'])) + { + $Block['element'] .= "\n"; + + unset($Block['interrupted']); + } + $Block['element'] .= "\n".$Line['body']; return $Block; diff --git a/test/data/sparse_html.html b/test/data/sparse_html.html new file mode 100644 index 0000000..9e89627 --- /dev/null +++ b/test/data/sparse_html.html @@ -0,0 +1,8 @@ +
+line 1 + +line 2 +line 3 + +line 4 +
\ No newline at end of file diff --git a/test/data/sparse_html.md b/test/data/sparse_html.md new file mode 100644 index 0000000..9e89627 --- /dev/null +++ b/test/data/sparse_html.md @@ -0,0 +1,8 @@ +
+line 1 + +line 2 +line 3 + +line 4 +
\ No newline at end of file