add title example

This commit is contained in:
Philipp Kühn
2019-06-21 22:00:42 +02:00
parent d99509cdb7
commit 443045bbdf
5 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { Node } from 'tiptap'
export default class Title extends Node {
get name() {
return 'title'
}
get schema() {
return {
content: 'inline*',
parseDOM: [{
tag: 'h1',
}],
toDOM: () => ['h1', 0],
}
}
}