1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import { TableHeader } from '@tiptap/extension-table-header'
export default TableHeader.extend({
content: 'inline*',
toMarkdown(state, node) {
state.write(' ')
state.renderInline(node)
state.write(' |')
},
parseHTML() {
return [
{ tag: 'table thead:empty ~ tbody :first-child th', priority: 80 },
{ tag: 'table thead:empty ~ tbody :first-child td', priority: 80 },
{ tag: 'table thead :first-child th', priority: 60 },
{ tag: 'table thead :first-child td', priority: 60 },
{ tag: 'table tbody :first-child th', priority: 60 },
{ tag: 'table tbody :first-child td', priority: 60 },
{ tag: 'table > :first-child > th', priority: 60 },
{ tag: 'table > :first-child > td', priority: 60 },
]
},
})
|