Skip to content

Commit

Permalink
misc: split tags by commas
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyphyn committed Aug 5, 2024
1 parent 9979c48 commit 8fb1777
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/lib/components/lemmy/post/PostMeta.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@
let extracted: Tag[] = []
title = title.replace(/\[(.*?)\]/g, (match, content) => {
extracted.push(
textToTag.get(content) ?? {
content: content,
}
)
const contents = content.split(',').map((part: string) => part.trim())
contents.forEach((content: string) => {
extracted.push(
textToTag.get(content) ?? {
content: content,
}
)
})
return ''
})
Expand Down

0 comments on commit 8fb1777

Please sign in to comment.