Scrolled to bottom fix.
This commit is contained in:
parent
bf723db2cc
commit
40a292d05e
@ -81,7 +81,7 @@ class ChatInputComponent extends HTMLElement {
|
|||||||
distance += 10
|
distance += 10
|
||||||
}
|
}
|
||||||
|
|
||||||
console.info([ mention, author, distance ]);
|
console.warn([ mention, author, distance ]);
|
||||||
if (distance < minDistance) {
|
if (distance < minDistance) {
|
||||||
minDistance = distance;
|
minDistance = distance;
|
||||||
closestAuthor = author;
|
closestAuthor = author;
|
||||||
@ -129,11 +129,9 @@ levenshteinDistance(a, b) {
|
|||||||
const mentions = this.extractMentions(text);
|
const mentions = this.extractMentions(text);
|
||||||
|
|
||||||
const matches = this.matchMentionsToAuthors(mentions, authors);
|
const matches = this.matchMentionsToAuthors(mentions, authors);
|
||||||
console.info(matches)
|
|
||||||
let updatedText = text;
|
let updatedText = text;
|
||||||
matches.forEach(({ mention, closestAuthor }) => {
|
matches.forEach(({ mention, closestAuthor }) => {
|
||||||
const mentionRegex = new RegExp(`@${mention}`, 'g');
|
const mentionRegex = new RegExp(`@${mention}`, 'g');
|
||||||
console.info(closestAuthor)
|
|
||||||
updatedText = updatedText.replace(mentionRegex, `@${closestAuthor}`);
|
updatedText = updatedText.replace(mentionRegex, `@${closestAuthor}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user