Allow to use emoji's as icons, fix #1997
This commit is contained in:
parent
1bab69c71f
commit
9deae9e659
5 changed files with 40 additions and 3 deletions
10
src/Utils.ts
10
src/Utils.ts
|
@ -1659,4 +1659,14 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static emojiRegex = /^\p{Extended_Pictographic}+$/u
|
||||
|
||||
/**
|
||||
* Returns 'true' if the given string contains at least one and only emoji characters
|
||||
* @param string
|
||||
*/
|
||||
public static isEmoji(string: string){
|
||||
return Utils.emojiRegex.test(string)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue