diff --git a/src/server/routers/note.ts b/src/server/routers/note.ts index 086579f..c14d3c4 100644 --- a/src/server/routers/note.ts +++ b/src/server/routers/note.ts @@ -163,9 +163,9 @@ export const noteRouter = router({ .mutation(async function ({ input, ctx }) { let { id, isArchived, type, attachments, content, isTop, isShare } = input if (content != null) { - content = content?.replace(/\\/g, '').replace(/ /g, ' ') + content = content?.replace(/ /g, ' ') } - const tagTree = helper.buildHashTagTreeFromHashString(extractHashtags(content + ' ')) + const tagTree = helper.buildHashTagTreeFromHashString(extractHashtags(content?.replace(/\\/g, '') + ' ')) let newTags: Prisma.tagCreateManyInput[] = [] const handleAddTags = async (tagTree: TagTreeNode[], parentTag: Prisma.tagCreateManyInput | undefined, noteId?: number) => { for (const i of tagTree) {