Skip to content

Commit 8883c2d

Browse files
Enhance TipTapView by adding custom class attributes for hard breaks and paragraphs, improving styling consistency. Also, enable line breaks in markdown handling for better text formatting.
1 parent 926c4fb commit 8883c2d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

components/tiptap-view.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,24 @@ export function TipTapView({ content, className = '' }: TipTapViewProps) {
2121
},
2222
heading: {
2323
levels: [1, 2, 3]
24+
},
25+
hardBreak: {
26+
keepMarks: true,
27+
HTMLAttributes: {
28+
class: 'my-2'
29+
}
30+
},
31+
paragraph: {
32+
HTMLAttributes: {
33+
class: 'mb-2'
34+
}
2435
}
2536
}),
2637
Markdown.configure({
2738
html: false,
2839
transformPastedText: true,
29-
transformCopiedText: true
40+
transformCopiedText: true,
41+
breaks: true
3042
})
3143
],
3244
content: typeof content === 'string' ? (content.startsWith('"') ? JSON.parse(content) : content) : '',

0 commit comments

Comments
 (0)