Parse html tags out of status content before applying filters. (#2713)

Fixes #2660
This commit is contained in:
Levi Bard 2022-10-14 20:03:19 +02:00 committed by GitHub
commit 9dd3a3d79b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 1 deletions

View file

@ -3,6 +3,7 @@ package com.keylesspalace.tusky.network
import android.text.TextUtils
import com.keylesspalace.tusky.entity.Filter
import com.keylesspalace.tusky.entity.Status
import com.keylesspalace.tusky.util.parseAsMastodonHtml
import java.util.Date
import java.util.regex.Pattern
import javax.inject.Inject
@ -34,7 +35,7 @@ class FilterModel @Inject constructor() {
.mapNotNull { it.description }
return (
matcher.reset(status.actionableStatus.content).find() ||
matcher.reset(status.actionableStatus.content.parseAsMastodonHtml().toString()).find() ||
(spoilerText.isNotEmpty() && matcher.reset(spoilerText).find()) ||
(
attachmentsDescriptions.isNotEmpty() &&