Skip to content

Commit

Permalink
fix: escape character replace issue #143
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinko committed Nov 20, 2024
1 parent da896c9 commit 64336b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/routers/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 64336b0

Please sign in to comment.