add generic figure experiment

This commit is contained in:
Philipp Kühn
2021-07-28 00:01:30 +02:00
parent 51fef7d49a
commit f25a65fb19
5 changed files with 294 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { Node, mergeAttributes } from '@tiptap/core'
export const Figcaption = Node.create({
name: 'figcaption',
defaultOptions: {
HTMLAttributes: {},
},
content: 'inline*',
selectable: false,
draggable: false,
parseHTML() {
return [
{
tag: 'figcaption',
},
]
},
renderHTML({ HTMLAttributes }) {
return ['figcaption', mergeAttributes(HTMLAttributes), 0]
},
})