Files
tiptap/demos/src/Experiments/GenericFigure/Vue/figcaption.ts
Dominik 8c6751f0c6 add precommit hook for linting and automatic eslint fixes + update eslint packages (#2862)
* chore: add precommit hook for eslint fixes, fix linting issues
* chore: add eslint import sort plugin
2022-06-08 14:10:25 +02:00

30 lines
441 B
TypeScript

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