mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
feat: feedback (#156)
* minimal tiptap * wip * img edit block * wip * fix
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export * from './reset-marks-on-enter'
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Extension } from '@tiptap/core'
|
||||
|
||||
export const ResetMarksOnEnter = Extension.create({
|
||||
name: 'resetMarksOnEnter',
|
||||
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
Enter: ({ editor }) => {
|
||||
if (
|
||||
editor.isActive('bold') ||
|
||||
editor.isActive('italic') ||
|
||||
editor.isActive('strike') ||
|
||||
editor.isActive('underline') ||
|
||||
editor.isActive('code')
|
||||
) {
|
||||
editor.commands.splitBlock({ keepMarks: false })
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user