custom_emoji: fix showing emojis that may look like a regular expression

main
Alibek Omarov 5 years ago
parent df315a3f3e
commit 6100868c7a
  1. 3
      app/src/main/java/com/keylesspalace/tusky/util/CustomEmojiHelper.java

@ -56,7 +56,8 @@ public class CustomEmojiHelper {
SpannableStringBuilder builder = new SpannableStringBuilder(text);
for (Emoji emoji : emojis) {
CharSequence pattern = new StringBuilder(":").append(emoji.getShortcode()).append(':');
Matcher matcher = Pattern.compile(pattern.toString()).matcher(text);
Matcher matcher = Pattern.compile(pattern.toString(), Pattern.LITERAL)
.matcher(text);
while (matcher.find()) {
EmojiSpan span = new EmojiSpan(view);
builder.setSpan(span, matcher.start(), matcher.end(), 0);

Loading…
Cancel
Save