tiptap/packages/core/src/Mark.ts

19 lines
325 B
TypeScript
Raw Normal View History

2020-03-30 18:40:25 +08:00
import Extension from './Extension'
2020-04-01 04:57:39 +08:00
import { MarkSpec } from 'prosemirror-model'
2020-03-30 18:40:25 +08:00
export default abstract class Mark extends Extension {
constructor(options = {}) {
super(options)
}
2020-04-11 04:07:27 +08:00
public extensionType = 'mark'
2020-03-30 18:40:25 +08:00
2020-04-01 04:57:39 +08:00
abstract schema(): MarkSpec
2020-03-30 18:40:25 +08:00
2020-04-11 04:07:27 +08:00
get type() {
2020-03-30 18:40:25 +08:00
return this.editor.schema.marks[this.name]
}
}