FIX: Use proper upper/lower case when previewing mentions
This commit is contained in:
parent
436e84c6c1
commit
e4085a64ce
|
@ -12,7 +12,7 @@ function updateFound($mentions, usernames) {
|
||||||
$mentions.each((i, e) => {
|
$mentions.each((i, e) => {
|
||||||
const $e = $(e);
|
const $e = $(e);
|
||||||
const username = usernames[i];
|
const username = usernames[i];
|
||||||
if (found.indexOf(username) !== -1) {
|
if (found.indexOf(username.toLowerCase()) !== -1) {
|
||||||
replaceSpan($e, username);
|
replaceSpan($e, username);
|
||||||
} else if (checked.indexOf(username) !== -1) {
|
} else if (checked.indexOf(username) !== -1) {
|
||||||
$e.addClass('mention-tested');
|
$e.addClass('mention-tested');
|
||||||
|
@ -24,7 +24,7 @@ function updateFound($mentions, usernames) {
|
||||||
export function linkSeenMentions($elem, siteSettings) {
|
export function linkSeenMentions($elem, siteSettings) {
|
||||||
const $mentions = $('span.mention:not(.mention-tested)', $elem);
|
const $mentions = $('span.mention:not(.mention-tested)', $elem);
|
||||||
if ($mentions.length) {
|
if ($mentions.length) {
|
||||||
const usernames = $mentions.map((_, e) => $(e).text().substr(1).toLowerCase());
|
const usernames = $mentions.map((_, e) => $(e).text().substr(1));
|
||||||
const unseen = _.uniq(usernames).filter((u) => {
|
const unseen = _.uniq(usernames).filter((u) => {
|
||||||
return u.length >= siteSettings.min_username_length && checked.indexOf(u) === -1;
|
return u.length >= siteSettings.min_username_length && checked.indexOf(u) === -1;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue