tiptap/packages/extension-paragraph/index.ts

18 lines
332 B
TypeScript
Raw Normal View History

2020-03-06 03:30:58 +08:00
import { Node } from '@tiptap/core'
2020-04-01 04:57:39 +08:00
import { NodeSpec } from 'prosemirror-model'
2020-03-06 03:30:58 +08:00
export default class Paragraph extends Node {
name = 'paragraph'
2020-04-01 04:57:39 +08:00
schema(): NodeSpec {
2020-03-29 06:54:49 +08:00
return {
content: 'inline*',
group: 'block',
draggable: false,
parseDOM: [{ tag: 'p' }],
toDOM: () => ['p', 0],
}
2020-03-06 03:30:58 +08:00
}
}