diff --git a/vendor/gems/discourse_emoji/vendor/assets/javascripts/discourse_emoji.js b/vendor/gems/discourse_emoji/vendor/assets/javascripts/discourse_emoji.js index 9f972d323fb..3bd1e0613c6 100644 --- a/vendor/gems/discourse_emoji/vendor/assets/javascripts/discourse_emoji.js +++ b/vendor/gems/discourse_emoji/vendor/assets/javascripts/discourse_emoji.js @@ -7,7 +7,8 @@ MD = event.MD; dialect.inline[":"] = function(text, orig_match) { - var m = /\:([a-z\_\+\-0-9]+)\:/.exec(text); + var m = /^\:([a-z\_\+\-0-9]+)\:/.exec(text); + if (m && (emoji.indexOf(m[1]) !== -1)) { var url = Discourse.getURL('/assets/emoji/' + m[1] + '.png'); return [m[0].length, ['img', {href: url, title: ':' + m[1] + ':', 'class': 'emoji', alt: m[1]}] ]; @@ -15,6 +16,7 @@ }; }); + if (Discourse && Discourse.ComposerView) { Discourse.ComposerView.on("initWmdEditor", function(event){