mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-19 13:47:51 +08:00
18 lines
349 B
TypeScript
18 lines
349 B
TypeScript
import { Node } from '@tiptap/core'
|
|
|
|
export default new Node()
|
|
.name('code_block')
|
|
.schema(() => ({
|
|
content: 'text*',
|
|
marks: '',
|
|
group: 'block',
|
|
code: true,
|
|
defining: true,
|
|
draggable: false,
|
|
parseDOM: [
|
|
{ tag: 'pre', preserveWhitespace: 'full' },
|
|
],
|
|
toDOM: () => ['pre', ['code', 0]],
|
|
}))
|
|
.create()
|