Sha256: fc0e19b8cadaef38c459c1b4885553a2777f6f18d8b7930fea27420c58371caa
Contents?: true
Size: 849 Bytes
Versions: 25
Compression:
Stored size: 849 Bytes
Contents
import { Node } from 'tiptap' import { chainCommands, exitCode } from 'tiptap-commands' export default class LineBreak extends Node { get name() { return 'line_break' } get schema() { return { inline: true, group: 'inline', selectable: false, parseDOM: [{ tag: 'br' }], toDOM: () => ['br'], } } commands({ type }) { return () => chainCommands(exitCode, (state, dispatch) => { dispatch(state.tr.replaceSelectionWith(type.create()).scrollIntoView()) return true }) } keys({ type }) { const command = chainCommands(exitCode, (state, dispatch) => { dispatch(state.tr.replaceSelectionWith(type.create()).scrollIntoView()) return true }) return { Enter: command, 'Mod-Enter': command, 'Shift-Enter': command, } } }
Version data entries
25 entries across 25 versions & 1 rubygems