FIX: Emoticons were parsing twice sometimes.

This commit is contained in:
Robin Ward 2013-08-23 22:56:00 -04:00
parent 50bab18206
commit 9ca0b0fe96
1 changed files with 3 additions and 1 deletions

View File

@ -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){