add generic figure experiment
This commit is contained in:
27
docs/src/demos/Experiments/GenericFigure/figcaption.ts
Normal file
27
docs/src/demos/Experiments/GenericFigure/figcaption.ts
Normal 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]
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user