From 2a7104e56486339e6ee253de043625c4c68dc109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Mart=C3=ADnez?= Date: Sat, 15 Jul 2023 04:00:35 +0200 Subject: [PATCH] fix: exclude commas in tags (#1957) --- api/v1/tag.go | 2 +- web/src/labs/marked/parser/Tag.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v1/tag.go b/api/v1/tag.go index c6188ef9..acd8407b 100644 --- a/api/v1/tag.go +++ b/api/v1/tag.go @@ -176,7 +176,7 @@ func convertTagFromStore(tag *store.Tag) *Tag { } } -var tagRegexp = regexp.MustCompile(`#([^\s#]+)`) +var tagRegexp = regexp.MustCompile(`#([^\s#,]+)`) func findTagListFromMemoContent(memoContent string) []string { tagMapSet := make(map[string]bool) diff --git a/web/src/labs/marked/parser/Tag.tsx b/web/src/labs/marked/parser/Tag.tsx index 5e74b5f4..95e197a8 100644 --- a/web/src/labs/marked/parser/Tag.tsx +++ b/web/src/labs/marked/parser/Tag.tsx @@ -1,6 +1,6 @@ import { matcher } from "../matcher"; -export const TAG_REG = /#([^\s#]+)/; +export const TAG_REG = /#([^\s#,]+)/; const renderer = (rawStr: string) => { const matchResult = matcher(rawStr, TAG_REG);