add basic inputrules and pasterules
This commit is contained in:
23
packages/extension-codeblock/index.ts
Normal file
23
packages/extension-codeblock/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Node } from '@tiptap/core'
|
||||
import { NodeSpec } from 'prosemirror-model'
|
||||
|
||||
export default class CodeBlock extends Node {
|
||||
|
||||
name = 'code_block'
|
||||
|
||||
schema(): NodeSpec {
|
||||
return {
|
||||
content: 'text*',
|
||||
marks: 'italic',
|
||||
group: 'block',
|
||||
code: true,
|
||||
defining: true,
|
||||
draggable: false,
|
||||
parseDOM: [
|
||||
{ tag: 'pre', preserveWhitespace: 'full' },
|
||||
],
|
||||
toDOM: () => ['pre', ['code', 0]],
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user