diff --git a/src/markdown/markdown.js b/src/markdown/markdown.js
index f8ca992..90a10d5 100644
--- a/src/markdown/markdown.js
+++ b/src/markdown/markdown.js
@@ -203,13 +203,9 @@ export function markdownToHTML(text) {
}
if (seenNonEmpty) {
- if (emptyCount === 0) {
+ const breaksToAdd = Math.max(1, emptyCount);
+ for (let j = 0; j < breaksToAdd; j += 1) {
htmlLines.push("
");
- } else {
- const extraBreaks = Math.max(0, emptyCount - 1);
- for (let j = 0; j < extraBreaks; j += 1) {
- htmlLines.push("
");
- }
}
} else if (emptyCount > 0) {
const extraBreaks = Math.max(0, emptyCount - 1);