this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix conditions not scoped properly

+7 -6
+7 -6
src/components/name-text.jsx
··· 21 21 22 22 const trimmedUsername = username.toLowerCase().trim(); 23 23 const trimmedDisplayName = (displayName || '').toLowerCase().trim(); 24 + const shortenedDisplayName = trimmedDisplayName 25 + .replace(/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g, '') // Remove shortcodes, regex from https://regex101.com/r/iE9uV0/1 26 + .replace(/\s+/g, '') // E.g. "My name" === "myname" 27 + .replace(/[^a-z0-9]/gi, ''); // Remove non-alphanumeric characters 24 28 25 29 if ( 26 - (!short && trimmedUsername === trimmedDisplayName) || 27 - trimmedUsername === 28 - trimmedDisplayName 29 - .replace(/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g, '') // Remove shortcodes, regex from https://regex101.com/r/iE9uV0/1 30 - .replace(/\s+/g, '') // E.g. "My name" === "myname" 31 - .replace(/[^a-z0-9]/gi, '') // Remove non-alphanumeric characters 30 + !short && 31 + (trimmedUsername === trimmedDisplayName || 32 + trimmedUsername === shortenedDisplayName) 32 33 ) { 33 34 username = null; 34 35 }