Perform bidirectionality isolation manually instead of relying on BidiFormatter (#1976)
* Perform manual isolation of display names etc. instead of relying on BidiFormatter. Fixes #1921 * Make follow request notification header formatting more like other notifications
This commit is contained in:
parent
d7e47caef3
commit
2170e6b0fa
6 changed files with 49 additions and 34 deletions
|
|
@ -80,3 +80,12 @@ fun Spanned.trimTrailingWhitespace(): Spanned {
|
|||
} while (i >= 0 && get(i).isWhitespace())
|
||||
return subSequence(0, i + 1) as Spanned
|
||||
}
|
||||
|
||||
/**
|
||||
* BidiFormatter.unicodeWrap is insufficient in some cases (see #1921)
|
||||
* So we force isolation manually
|
||||
* https://unicode.org/reports/tr9/#Explicit_Directional_Isolates
|
||||
*/
|
||||
fun CharSequence.unicodeWrap(): String {
|
||||
return "\u2068${this}\u2069"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue