From e23a0e20cc3f176af893889184a3ee6e914b5712 Mon Sep 17 00:00:00 2001 From: Taras Smakula <tarassmakula@gmail.com> Date: Thu, 30 Nov 2023 14:30:25 +0200 Subject: [PATCH] Add SoftBreakAddsNewLinePlugin --- .../org/futo/circles/core/feature/markdown/MarkdownParser.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/org/futo/circles/core/feature/markdown/MarkdownParser.kt b/core/src/main/java/org/futo/circles/core/feature/markdown/MarkdownParser.kt index 38040c8b6..19dc00121 100644 --- a/core/src/main/java/org/futo/circles/core/feature/markdown/MarkdownParser.kt +++ b/core/src/main/java/org/futo/circles/core/feature/markdown/MarkdownParser.kt @@ -7,6 +7,7 @@ import android.text.style.StyleSpan import io.noties.markwon.AbstractMarkwonPlugin import io.noties.markwon.Markwon import io.noties.markwon.MarkwonSpansFactory +import io.noties.markwon.SoftBreakAddsNewLinePlugin import io.noties.markwon.ext.strikethrough.StrikethroughPlugin import io.noties.markwon.linkify.LinkifyPlugin import org.commonmark.node.Emphasis @@ -22,12 +23,14 @@ object MarkdownParser { const val mentionMark = "@" fun markwonBuilder(context: Context): Markwon = Markwon.builder(context) + .usePlugin(SoftBreakAddsNewLinePlugin.create()) .usePlugin(StrikethroughPlugin.create()) .usePlugin(LinkifyPlugin.create()) .usePlugin(MentionPlugin(context)) .build() fun markwonNotificationBuilder(context: Context): Markwon = Markwon.builder(context) + .usePlugin(SoftBreakAddsNewLinePlugin.create()) .usePlugin(object : AbstractMarkwonPlugin() { override fun configureSpansFactory(builder: MarkwonSpansFactory.Builder) { builder.setFactory( -- GitLab