Fix wierd issue when trying to open reddit@lemmy.world

This commit is contained in:
Balazs Toldi 2023-08-10 21:03:04 +02:00
parent 21b111cc2d
commit 37ab47bc34
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58

View File

@ -6,7 +6,10 @@ import android.text.SpannableStringBuilder
import android.text.style.URLSpan
import android.text.util.Linkify
import eu.toldi.infinityforlemmy.utils.LemmyUtils
import io.noties.markwon.*
import io.noties.markwon.AbstractMarkwonPlugin
import io.noties.markwon.MarkwonPlugin
import io.noties.markwon.MarkwonVisitor
import io.noties.markwon.SpannableBuilder
import io.noties.markwon.core.CorePlugin
import io.noties.markwon.core.CoreProps
import org.commonmark.node.Link
@ -36,13 +39,13 @@ class MarkwonLemmyLinkPlugin : AbstractMarkwonPlugin() {
* Pattern to match lemmy's unique community pattern, e.g. !commmunity[@instance]
*/
val lemmyCommunityPattern: Pattern =
Pattern.compile("(?<!\\S)!($communityPatternFragment)(?:@($instancePatternFragment))?\\b")
Pattern.compile("(?<!\\S)!($communityPatternFragment)(?:@($instancePatternFragment))\\b")
/**
* Pattern to match lemmy's unique user pattern, e.g. @user[@instance]
*/
val lemmyUserPattern: Pattern =
Pattern.compile("(?<!\\S)@($userPatternFragment)(?:@($instancePatternFragment))?\\b")
Pattern.compile("(?<!\\S)@($userPatternFragment)(?:@($instancePatternFragment))\\b")
}
override fun configure(registry: MarkwonPlugin.Registry) {