about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorOndřej Hruška <ondra@ondrovo.com>2017-08-01 00:16:05 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-08-01 00:16:05 +0200
commite9ee249fd50760e13dd02712cbe496f1d660912b (patch)
treef99c46e12cf2f9e34e3da8f7b7edddcbd243227a /app
parent4b6cd1dfdb67923d7ad142422ec935293a28745e (diff)
do not emojify tm, (R) and (C) (#4472)
Diffstat (limited to 'app')
-rw-r--r--app/javascript/mastodon/emoji.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/emoji.js b/app/javascript/mastodon/emoji.js
index 9b58cacf5..5695c86dd 100644
--- a/app/javascript/mastodon/emoji.js
+++ b/app/javascript/mastodon/emoji.js
@@ -3,6 +3,8 @@ import Trie from 'substring-trie';
 
 const trie = new Trie(Object.keys(unicodeMapping));
 
+const excluded = ['™', '©', '®'];
+
 function emojify(str) {
   // This walks through the string from start to end, ignoring any tags (<p>, <br>, etc.)
   // and replacing valid unicode strings
@@ -19,7 +21,7 @@ function emojify(str) {
       insideTag = true;
     } else if (!insideTag && (match = trie.search(str.substring(i)))) {
       const unicodeStr = match;
-      if (unicodeStr in unicodeMapping) {
+      if (unicodeStr in unicodeMapping && excluded.indexOf(unicodeStr) === -1) {
         const [filename, shortCode] = unicodeMapping[unicodeStr];
         const alt      = unicodeStr;
         const replacement =  `<img draggable="false" class="emojione" alt="${alt}" title=":${shortCode}:" src="/emoji/${filename}.svg" />`;