Remove special characters in avatar (#13766)
* Remove special characters * Remove some chars not all
This commit is contained in:
committed by
GitHub
parent
eaf7994dca
commit
371679b2e5
@@ -69,8 +69,9 @@ Use this directive to render an avatar.
|
||||
}
|
||||
|
||||
function getNameInitials(name) {
|
||||
if(name) {
|
||||
var names = name.split(' '),
|
||||
if (name) {
|
||||
const notAllowed = /[\[\]\{\}\*\?\&\$\@\!\(\)\%\#]+/g;
|
||||
var names = name.replace(notAllowed,'').trim().split(' '),
|
||||
initials = names[0].substring(0, 1);
|
||||
|
||||
if (names.length > 1) {
|
||||
|
||||
Reference in New Issue
Block a user