description | icon |
---|---|
Sometimes we all need a break, even if it’s just a line break. |
text-wrap |
The HardBreak extensions adds support for the <br>
HTML tag, which forces a line break.
npm install @tiptap/extension-hard-break
Custom HTML attributes that should be added to the rendered HTML tag.
HardBreak.configure({
HTMLAttributes: {
class: 'my-custom-class',
},
})
Decides whether to keep marks after a line break. Based on the keepOnSplit
option for marks.
Default: true
HardBreak.configure({
keepMarks: false,
})
Add a line break.
editor.commands.setHardBreak()
Command | Windows/Linux | macOS |
---|---|---|
setHardBreak | Shift Enter Control Enter |
Shift Enter Cmd Enter |