From 9de129a35bce08bba1548557ae29a4a0d8bb1333 Mon Sep 17 00:00:00 2001 From: rebelonion <87634197+rebelonion@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:29:06 -0600 Subject: [PATCH] fix: block some tags --- .../java/ani/dantotsu/media/comments/CommentsActivity.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ani/dantotsu/media/comments/CommentsActivity.kt b/app/src/main/java/ani/dantotsu/media/comments/CommentsActivity.kt index 1fc230584b..276cc90a04 100644 --- a/app/src/main/java/ani/dantotsu/media/comments/CommentsActivity.kt +++ b/app/src/main/java/ani/dantotsu/media/comments/CommentsActivity.kt @@ -41,6 +41,7 @@ import io.noties.markwon.ext.strikethrough.StrikethroughPlugin import io.noties.markwon.ext.tables.TablePlugin import io.noties.markwon.ext.tasklist.TaskListPlugin import io.noties.markwon.html.HtmlPlugin +import io.noties.markwon.html.TagHandlerNoOp import io.noties.markwon.image.AsyncDrawable import io.noties.markwon.image.glide.GlideImagesPlugin import kotlinx.coroutines.Dispatchers @@ -500,9 +501,13 @@ class CommentsActivity : AppCompatActivity() { val markwon = Markwon.builder(this) .usePlugin(SoftBreakAddsNewLinePlugin.create()) .usePlugin(StrikethroughPlugin.create()) - .usePlugin(HtmlPlugin.create()) .usePlugin(TablePlugin.create(this)) .usePlugin(TaskListPlugin.create(this)) + .usePlugin(HtmlPlugin.create { plugin -> + plugin.addHandler( + TagHandlerNoOp.create("h1", "h2", "h3", "h4", "h5", "h6", "hr", "pre") + ) + }) .usePlugin(GlideImagesPlugin.create(object : GlideImagesPlugin.GlideStore { private val requestManager: RequestManager =