1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2025-01-11 08:53:54 +01:00
tateisu 2018-04-09 03:05:18 +09:00
parent 2c0282a48d
commit 87d5d78de5

View File

@ -30,7 +30,7 @@ object EmojiDecoder {
// }
private const val cpColon = ':'.toInt()
fun canStartShortCode(s : CharSequence, index : Int) : Boolean {
val cp = s.codePointBefore(index)
return when(cp) {
@ -171,8 +171,12 @@ object EmojiDecoder {
openNormalText()
val length = Character.charCount(s.codePointAt(i))
if(length == 1) {
sb.append(s[i])
++ i
val c = s[i++]
sb.append(when(c) {
// https://github.com/tateisu/SubwayTooter/issues/69
'\u00AD' -> '-'
else -> c
})
} else {
sb.append(s.substring(i, i + length))
i += length