mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-17 13:30:33 -04:00
Remove zero whitespace from CJK languages in app details
where that text could get copied to the clipboard
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user