diff --git a/src/view/com/composer/TagInput/index.tsx b/src/view/com/composer/TagInput/index.tsx index 64565c2530..afd6569cb0 100644 --- a/src/view/com/composer/TagInput/index.tsx +++ b/src/view/com/composer/TagInput/index.tsx @@ -28,7 +28,10 @@ function uniq(tags: string[]) { } function sanitize(tagString: string) { - return tagString.trim().replace(/^#/, '') + return tagString + .trim() + .replace(/^#/, '') + .replace(/\p{P}+$/gu, '') } export function TagInput({ diff --git a/src/view/com/composer/TagInput/index.web.tsx b/src/view/com/composer/TagInput/index.web.tsx index 44f5cdfd85..76406945c9 100644 --- a/src/view/com/composer/TagInput/index.web.tsx +++ b/src/view/com/composer/TagInput/index.web.tsx @@ -27,7 +27,10 @@ function uniq(tags: string[]) { } function sanitize(tagString: string) { - return tagString.trim().replace(/^#/, '') + return tagString + .trim() + .replace(/^#/, '') + .replace(/\p{P}+$/gu, '') } export function TagInput({