Skip to content

Commit

Permalink
Trim extra paragraph tags from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
casesandberg committed Sep 27, 2024
1 parent 35ba6a5 commit 09878ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/comments/lib/createComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ export async function createComment({
entityType,
entityId,
}: Pick<Comment, 'content' | 'authorId' | 'parentId' | 'entityType' | 'entityId'>) {
const trimmedContent = content.replace(/<p><\/p>/g, '')

const comment = await db.comment.create({
data: {
content,
content: trimmedContent,
authorId,
parentId,
entityType,
Expand Down

0 comments on commit 09878ff

Please sign in to comment.