diff --git a/common/util/parse.ts b/common/util/parse.ts index 5f78125e..99e5a82c 100644 --- a/common/util/parse.ts +++ b/common/util/parse.ts @@ -10,9 +10,9 @@ export function parseTags(text: string) { } export function parseWordsAsTags(text: string) { - const regex = /(?:^|\s)(?:[a-z0-9_]+)/gi + const regex = /(?:^|\s)(?:#?[a-z0-9_]+)/gi const matches = (text.match(regex) || []) - .map((match) => match.trim()) + .map((match) => match.replace('#', '').trim()) .filter((tag) => tag) const tagSet = new Set(matches) const uniqueTags: string[] = []