diff options
author | Linnea Gräf <nea@nea.moe> | 2024-04-29 16:11:35 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-04-29 16:11:35 +0200 |
commit | 1ff704d63c057f0fca37b27cf0259e3c5af7299f (patch) | |
tree | c8073191cf879c449c97b63f58cabcefefaa4674 /src/main/kotlin/moe | |
parent | 9513802ef7637a469c72a2dedd68d5bf9215ba4d (diff) | |
download | blog-infra-1ff704d63c057f0fca37b27cf0259e3c5af7299f.tar.gz blog-infra-1ff704d63c057f0fca37b27cf0259e3c5af7299f.tar.bz2 blog-infra-1ff704d63c057f0fca37b27cf0259e3c5af7299f.zip |
Allow inlining italics
Diffstat (limited to 'src/main/kotlin/moe')
-rw-r--r-- | src/main/kotlin/moe/nea/blog/md/ItalicsParser.kt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/kotlin/moe/nea/blog/md/ItalicsParser.kt b/src/main/kotlin/moe/nea/blog/md/ItalicsParser.kt index 6fce529..5448f5f 100644 --- a/src/main/kotlin/moe/nea/blog/md/ItalicsParser.kt +++ b/src/main/kotlin/moe/nea/blog/md/ItalicsParser.kt @@ -2,7 +2,7 @@ package moe.nea.blog.md object ItalicsParser : InlineParser { override fun detect(lookback: MarkdownFormat, rest: String): Boolean { - return (lookback is Whitespace || lookback is Begin) && "\\*+[^* ].*".toRegex().matches(rest) + return "\\*+[^* ].*".toRegex().matches(rest) } override val specialSyntax: Set<Char> @@ -43,7 +43,10 @@ object ItalicsParser : InlineParser { } // TODO: better begin - val (secondSequence, _remainingText) = parser.parseInlineTextUntil(remainingText, Begin()) { lookback, remaining -> + val (secondSequence, _remainingText) = parser.parseInlineTextUntil( + remainingText, + Begin() + ) { lookback, remaining -> lookback !is Whitespace && remaining.startsWith("*") } remainingText = _remainingText |