mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 04:08:32 +03:00
Compare exact string before checking variants
This commit is contained in:
parent
4c17522d42
commit
f198571367
1 changed files with 6 additions and 5 deletions
|
@ -19,15 +19,16 @@ function NameText({
|
|||
|
||||
const displayNameWithEmoji = emojifyText(displayName, emojis);
|
||||
|
||||
const trimmedUsername = username.toLowerCase().trim();
|
||||
const trimmedDisplayName = (displayName || '').toLowerCase().trim();
|
||||
|
||||
if (
|
||||
!short &&
|
||||
username.toLowerCase().trim() ===
|
||||
(displayName || '')
|
||||
(!short && trimmedUsername === trimmedDisplayName) ||
|
||||
trimmedUsername ===
|
||||
trimmedDisplayName
|
||||
.replace(/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g, '') // Remove shortcodes, regex from https://regex101.com/r/iE9uV0/1
|
||||
.replace(/\s+/g, '') // E.g. "My name" === "myname"
|
||||
.replace(/[^a-z0-9]/gi, '') // Remove non-alphanumeric characters
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
) {
|
||||
username = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue