summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibMarkdown/Document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibMarkdown/Document.cpp')
-rw-r--r--Userland/Libraries/LibMarkdown/Document.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibMarkdown/Document.cpp b/Userland/Libraries/LibMarkdown/Document.cpp
index 3e91b9f67f..059bbc97c9 100644
--- a/Userland/Libraries/LibMarkdown/Document.cpp
+++ b/Userland/Libraries/LibMarkdown/Document.cpp
@@ -92,6 +92,7 @@ OwnPtr<Document> Document::parse(const StringView& str)
if ((*lines).is_empty()) {
++lines;
+
flush_paragraph();
continue;
}
@@ -108,8 +109,9 @@ OwnPtr<Document> Document::parse(const StringView& str)
continue;
}
+ if (!paragraph_text.is_empty())
+ paragraph_text.append("\n");
paragraph_text.append(*lines++);
- paragraph_text.append("\n");
}
flush_paragraph();