diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt b/src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt index 673a0ed..4705d4b 100644 --- a/src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt +++ b/src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt @@ -21,7 +21,15 @@ class MarkdownParser(source: String) { } fun readChildBlock(): MarkdownBlock? { - val peek = peekLine() ?: return null + var peek = "" + while (true) { + peek = peekLine() ?: return null + if (peek.isBlank()) { + consumeLine() + } else { + break + } + } val blockParser = findParserFor(peek) ?: ParagraphParser return blockParser.parse(this) } |