File tree 3 files changed +42
-8
lines changed
emojify/src/main/kotlin/io/wax911/emojify/parser
3 files changed +42
-8
lines changed Original file line number Diff line number Diff line change @@ -93,15 +93,17 @@ internal fun EmojiManager.htmlEncodedEmojiAt(
93
93
input.indexOf(' ;' , codePointStart + 3 ) // Code point must be at least 1 char in length
94
94
if (codePointEnd == - 1 ) break
95
95
96
- val result = runCatching {
97
- val radix = if (input[codePointStart + 2 ] == ' x' ) 16 else 10
98
- val codePoint =
99
- input.substring(codePointStart + 2 + radix / 16 , codePointEnd).toInt(radix)
100
- charsIndex + = Character .toChars(codePoint, chars, charsIndex)
101
- }
96
+ val result =
97
+ runCatching {
98
+ val radix = if (input[codePointStart + 2 ] == ' x' ) 16 else 10
99
+ val codePoint =
100
+ input.substring(codePointStart + 2 + radix / 16 , codePointEnd).toInt(radix)
101
+ charsIndex + = Character .toChars(codePoint, chars, charsIndex)
102
+ }
102
103
103
- if (result.isFailure)
104
+ if (result.isFailure) {
104
105
break
106
+ }
105
107
106
108
val foundEmoji = emojiTrie.getEmoji(chars, 0 , charsIndex)
107
109
if (foundEmoji != null ) {
@@ -123,7 +125,7 @@ internal fun EmojiManager.htmlEncodedEmojiAt(
123
125
emoji = longestEmoji,
124
126
fitzpatrick = Fitzpatrick .fitzpatrickFromUnicode(longestEmoji.unicode),
125
127
startIndex = codePointStart,
126
- endIndex = longestCodePointEnd
128
+ endIndex = longestCodePointEnd,
127
129
)
128
130
}
129
131
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2025 AniTrend
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
1
17
package io.wax911.emojify.parser.candidate
2
18
3
19
import io.wax911.emojify.contract.model.IEmoji
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2025 AniTrend
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
1
17
package io.wax911.emojify.parser.candidate.contract
2
18
3
19
import io.wax911.emojify.contract.model.IEmoji
You can’t perform that action at this time.
0 commit comments