mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
19 lines
460 B
TypeScript
19 lines
460 B
TypeScript
/*
|
|
* Wrap the horizontal rule in a div element.
|
|
* Also add a keyboard shortcut to insert a horizontal rule.
|
|
*/
|
|
import { HorizontalRule as TiptapHorizontalRule } from "@tiptap/extension-horizontal-rule"
|
|
|
|
export const HorizontalRule = TiptapHorizontalRule.extend({
|
|
addKeyboardShortcuts() {
|
|
return {
|
|
"Mod-Alt--": () =>
|
|
this.editor.commands.insertContent({
|
|
type: this.name,
|
|
}),
|
|
}
|
|
},
|
|
})
|
|
|
|
export default HorizontalRule
|