summaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt')
-rw-r--r--src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt5
1 files changed, 3 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 aaac6a1..5ee984f 100644
--- a/src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt
+++ b/src/main/kotlin/moe/nea/blog/md/MarkdownParser.kt
@@ -89,12 +89,12 @@ class MarkdownParser(source: String) {
var remaining = text
var lastToken: MarkdownFormat = initialLookback
while (remaining.isNotEmpty()) {
+ if (breakout(lastToken, remaining))
+ break
val (tok, next) = parseInlineTextOnce(lastToken, remaining)
seq.add(tok)
lastToken = tok
remaining = next
- if (breakout(tok, next))
- break
}
return seq to remaining
}
@@ -172,6 +172,7 @@ class MarkdownParser(source: String) {
blockParsers.add(ListParser)
inlineParsers.add(ItalicsParser)
inlineParsers.add(LinkParser)
+ inlineParsers.add(ImageParser)
}
fun getLineIndex(): Int {