mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: Obscure emoji fail with a colon surrounded by spaces
This commit is contained in:
parent
9d96fc6370
commit
a63ac64931
2 changed files with 6 additions and 14 deletions
|
@ -64,11 +64,9 @@
|
|||
return s.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')
|
||||
}
|
||||
|
||||
var translationColonRegexp = new RegExp("^" +
|
||||
Object.keys(translationsWithColon).map(function (t) {
|
||||
var translationColonRegexp = new RegExp(Object.keys(translationsWithColon).map(function (t) {
|
||||
return "(" + escapeRegExp(t) + ")";
|
||||
}).join("|")
|
||||
);
|
||||
}).join("|"));
|
||||
|
||||
Discourse.Dialect.registerInline(':', function(text, match, prev) {
|
||||
var endPos = text.indexOf(':', 1),
|
||||
|
@ -80,11 +78,11 @@
|
|||
// If there is no trailing colon, check our translations that begin with colons
|
||||
if (endPos === -1 || (firstSpace !== -1 && endPos > firstSpace)) {
|
||||
translationColonRegexp.lastIndex = 0;
|
||||
var match = translationColonRegexp.exec(text);
|
||||
if (match && match[0]) {
|
||||
contents = imageFor(translationsWithColon[match[0]]);
|
||||
var m = translationColonRegexp.exec(text);
|
||||
if (m && m[0] && text.indexOf(m[0]) === 0) {
|
||||
contents = imageFor(translationsWithColon[m[0]]);
|
||||
if (contents) {
|
||||
return [match[0].length, contents];
|
||||
return [m[0].length, contents];
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -131,9 +131,3 @@ test("dynamically toggles logo size when 'minimized' property changes", function
|
|||
setMinimized(false);
|
||||
ok(exists(fixture(bigLogoSelector)), "when 'minimized' version is turned off, small logo is replaced with the big one");
|
||||
});
|
||||
|
||||
test("links logo to the site root", function() {
|
||||
appendView();
|
||||
|
||||
equal(fixture(".title > a").attr("href"), "/");
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue