mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 Remove Unicode PUA characters https://github.com/siyuan-note/siyuan/issues/13291
This commit is contained in:
parent
18f68ac715
commit
7446599c0f
18 changed files with 29 additions and 22 deletions
|
|
@ -56,6 +56,12 @@ var emojiRegex = regexp.MustCompile(`/([0-9#][\x{20E3}])|` +
|
|||
|
||||
func RemoveEmojiInvisible(text string) (ret string) {
|
||||
ret = emojiRegex.ReplaceAllString(text, "")
|
||||
ret = gulu.Str.RemoveInvisible(ret)
|
||||
ret = RemoveInvalid(ret)
|
||||
return
|
||||
}
|
||||
|
||||
func RemoveInvalid(text string) (ret string) {
|
||||
ret = gulu.Str.RemoveInvisible(text)
|
||||
ret = gulu.Str.RemovePUA(text)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue