Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: exclude commas in tags (#1957)

Felipe Martínez2a7104e56486
diff --git a/api/v1/tag.go b/api/v1/tag.go
index c6188ef9d..acd8407b4 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 5e74b5f42..95e197a8a 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);