Remove zero whitespace from CJK languages in app details

where that text could get copied to the clipboard
This commit is contained in:
Torsten Grote
2026-03-16 11:38:32 -03:00
parent 1ed12630ca
commit abfaafeede
2 changed files with 7 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ import org.fdroid.index.v2.PackageVersion
import org.fdroid.install.InstallState
import org.fdroid.install.SessionInstallManager
import org.fdroid.ui.categories.CategoryItem
import org.fdroid.ui.search.SearchHelper.removeZeroWhiteSpace
data class AppDetailsItem(
val app: AppMetadata,
@@ -91,9 +92,9 @@ data class AppDetailsItem(
networkState = networkState,
preferredRepoId = preferredRepoId,
repositories = repositories,
name = dbApp.name ?: "Unknown App",
summary = dbApp.summary,
description = getHtmlDescription(dbApp.getDescription(localeList)),
name = dbApp.name?.removeZeroWhiteSpace() ?: "Unknown App",
summary = dbApp.summary?.removeZeroWhiteSpace() ?: "",
description = getHtmlDescription(dbApp.getDescription(localeList)?.removeZeroWhiteSpace()),
icon =
if (installedVersionCode == null) {
dbApp.getIcon(localeList)?.getImageModel(repository, proxy)

View File

@@ -12,6 +12,9 @@ object SearchHelper {
return Normalizer.normalize(this, NFKD).replace(normalizerRegex, "")
}
/** Removes zero-width spaces from the string. Useful when string is copy and pasted. */
fun String.removeZeroWhiteSpace(): String = this.replace("\u200B", "")
/**
* Normalize the query by removing diacritics and adding zero-width spaces after ideographic
* characters.