diff options
author | Linnea Gräf <nea@nea.moe> | 2024-05-03 00:02:29 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-05-03 00:02:29 +0200 |
commit | 1b563a0378998f2fed28bf81b8e254cb47742503 (patch) | |
tree | 0ab727813c2150b8293ebcd3d16bfe5ea4e25562 /src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt | |
parent | 7e24b934bbd424669a1c935894dd8799d4db0348 (diff) | |
download | blog-infra-master.tar.gz blog-infra-master.tar.bz2 blog-infra-master.zip |
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) } |