mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-31 04:51:02 +00:00
fix: some markdown fixes
This commit is contained in:
@@ -68,7 +68,6 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.AttrRes
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
@@ -98,6 +97,7 @@ import ani.dantotsu.databinding.ItemCountDownBinding
|
||||
import ani.dantotsu.media.Media
|
||||
import ani.dantotsu.media.MediaDetailsActivity
|
||||
import ani.dantotsu.notifications.IncognitoNotificationClickReceiver
|
||||
import ani.dantotsu.others.AlignTagHandler
|
||||
import ani.dantotsu.others.ImageViewDialog
|
||||
import ani.dantotsu.others.SpoilerPlugin
|
||||
import ani.dantotsu.parsers.ShowResponse
|
||||
@@ -119,8 +119,8 @@ import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withC
|
||||
import com.bumptech.glide.load.resource.gif.GifDrawable
|
||||
import com.bumptech.glide.request.RequestListener
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.bumptech.glide.request.target.CustomTarget
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import com.bumptech.glide.request.target.ViewTarget
|
||||
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
@@ -1448,6 +1448,8 @@ fun openOrCopyAnilistLink(link: String) {
|
||||
} else {
|
||||
copyToClipboard(link, true)
|
||||
}
|
||||
} else if (getYoutubeId(link).isNotEmpty()) {
|
||||
openLinkInYouTube(link)
|
||||
} else {
|
||||
copyToClipboard(link, true)
|
||||
}
|
||||
@@ -1484,6 +1486,7 @@ fun buildMarkwon(
|
||||
TagHandlerNoOp.create("h1", "h2", "h3", "h4", "h5", "h6", "hr", "pre", "a")
|
||||
)
|
||||
}
|
||||
plugin.addHandler(AlignTagHandler())
|
||||
})
|
||||
.usePlugin(GlideImagesPlugin.create(object : GlideImagesPlugin.GlideStore {
|
||||
|
||||
@@ -1527,3 +1530,11 @@ fun buildMarkwon(
|
||||
.build()
|
||||
return markwon
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun getYoutubeId(url: String): String {
|
||||
val regex = """(?:youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|(?:youtu\.be|youtube\.com)/)([^"&?/\s]{11})|youtube\.com/""".toRegex()
|
||||
val matchResult = regex.find(url)
|
||||
return matchResult?.groupValues?.getOrNull(1) ?: ""
|
||||
}
|
||||
Reference in New Issue
Block a user