add details experiment

This commit is contained in:
Hans Pagel
2021-02-10 15:48:20 +01:00
parent 90efee5622
commit 8c3b35d0c0
5 changed files with 144 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import { Node } from '@tiptap/core'
export interface DetailsSummaryOptions {
HTMLAttributes: {
[key: string]: any
},
}
export default Node.create({
name: 'detailsSummary',
content: 'inline*',
group: 'block',
defaultOptions: <DetailsSummaryOptions>{
HTMLAttributes: {},
},
parseHTML() {
return [{
tag: 'summary',
}]
},
renderHTML() {
return ['summary', 0]
},
})