diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/blog')
-rw-r--r-- | src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt | 10 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/blog/md/Paragraph.kt | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/blog/md/ext/NoteBlocks.kt | 2 |
3 files changed, 14 insertions, 2 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) } diff --git a/src/main/kotlin/moe/nea/blog/md/Paragraph.kt b/src/main/kotlin/moe/nea/blog/md/Paragraph.kt index 54f688b..f715e53 100644 --- a/src/main/kotlin/moe/nea/blog/md/Paragraph.kt +++ b/src/main/kotlin/moe/nea/blog/md/Paragraph.kt @@ -6,7 +6,11 @@ import java.io.PrintStream data class Paragraph(val format: MarkdownFormat) : MarkdownBlock { override fun debugFormat(indent: Int, printStream: PrintStream) { printStream.indent(indent) + printStream.println("<p>") + printStream.indent(indent) format.debugFormat(printStream) printStream.println() + printStream.indent(indent) + printStream.println("</p>") } }
\ No newline at end of file diff --git a/src/main/kotlin/moe/nea/blog/md/ext/NoteBlocks.kt b/src/main/kotlin/moe/nea/blog/md/ext/NoteBlocks.kt index a1f977f..6d13063 100644 --- a/src/main/kotlin/moe/nea/blog/md/ext/NoteBlocks.kt +++ b/src/main/kotlin/moe/nea/blog/md/ext/NoteBlocks.kt @@ -13,7 +13,7 @@ import java.io.PrintStream data class NoteBlock(val noteType: String, val child: MarkdownBlock) : MarkdownBlock { override fun debugFormat(indent: Int, printStream: PrintStream) { printStream.indent(indent) - printStream.println("<note type=\"$noteType\">") + printStream.println("<note type=$noteType>") child.debugFormat(indent + 2, printStream) |