Ver Fonte

Fix a bug that emoticon of <3 and >:) cannot display correctly in the message.

Derek Wang há 11 anos atrás
pai
commit
f7e7d1a658
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      converse.js

+ 2 - 2
converse.js

@@ -60,6 +60,7 @@
             if (this.length > 0) {
             if (this.length > 0) {
                 this.each(function(i, obj) {
                 this.each(function(i, obj) {
                     var text = $(obj).html();
                     var text = $(obj).html();
+                    text = text.replace(/&gt;:\)/g, '<span class="emoticon icon-evil"></span>');
                     text = text.replace(/:\)/g, '<span class="emoticon icon-smiley"></span>');
                     text = text.replace(/:\)/g, '<span class="emoticon icon-smiley"></span>');
                     text = text.replace(/:\-\)/g, '<span class="emoticon icon-smiley"></span>');
                     text = text.replace(/:\-\)/g, '<span class="emoticon icon-smiley"></span>');
                     text = text.replace(/;\)/g, '<span class="emoticon icon-wink"></span>');
                     text = text.replace(/;\)/g, '<span class="emoticon icon-wink"></span>');
@@ -71,7 +72,6 @@
                     text = text.replace(/:p/g, '<span class="emoticon icon-tongue"></span>');
                     text = text.replace(/:p/g, '<span class="emoticon icon-tongue"></span>');
                     text = text.replace(/:\-p/g, '<span class="emoticon icon-tongue"></span>');
                     text = text.replace(/:\-p/g, '<span class="emoticon icon-tongue"></span>');
                     text = text.replace(/8\)/g, '<span class="emoticon icon-cool"></span>');
                     text = text.replace(/8\)/g, '<span class="emoticon icon-cool"></span>');
-                    text = text.replace(/&gt;:\)/g, '<span class="emoticon icon-evil"></span>');
                     text = text.replace(/:S/g, '<span class="emoticon icon-confused"></span>');
                     text = text.replace(/:S/g, '<span class="emoticon icon-confused"></span>');
                     text = text.replace(/:\\/g, '<span class="emoticon icon-wondering"></span>');
                     text = text.replace(/:\\/g, '<span class="emoticon icon-wondering"></span>');
                     text = text.replace(/:\/ /g, '<span class="emoticon icon-wondering"></span>');
                     text = text.replace(/:\/ /g, '<span class="emoticon icon-wondering"></span>');
@@ -82,7 +82,7 @@
                     text = text.replace(/:\-O/g, '<span class="emoticon icon-shocked"></span>');
                     text = text.replace(/:\-O/g, '<span class="emoticon icon-shocked"></span>');
                     text = text.replace(/\=\-O/g, '<span class="emoticon icon-shocked"></span>');
                     text = text.replace(/\=\-O/g, '<span class="emoticon icon-shocked"></span>');
                     text = text.replace(/\(\^.\^\)b/g, '<span class="emoticon icon-thumbs-up"></span>');
                     text = text.replace(/\(\^.\^\)b/g, '<span class="emoticon icon-thumbs-up"></span>');
-                    text = text.replace(/<3/g, '<span class="emoticon icon-heart"></span>');
+                    text = text.replace(/&lt;3/g, '<span class="emoticon icon-heart"></span>');
                     $(obj).html(text);
                     $(obj).html(text);
                 });
                 });
             }
             }