tiptap/packages/html/src/example.js

25 lines
476 B
JavaScript
Raw Normal View History

2020-10-29 00:20:38 +08:00
import { generateHTML } from '@tiptap/html'
2020-09-04 19:44:27 +08:00
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
2020-09-24 05:38:11 +08:00
// eslint-disable-next-line
2020-10-29 00:20:38 +08:00
const html = generateHTML({
type: 'doc',
2020-09-24 05:38:11 +08:00
content: [{
type: 'paragraph',
attrs: {
align: 'left',
2020-09-04 19:44:27 +08:00
},
2020-09-24 05:38:11 +08:00
content: [{
type: 'text',
text: 'Example Text',
}],
}],
2020-09-04 19:44:27 +08:00
}, [
new Document(),
new Paragraph(),
new Text(),
2020-09-24 05:38:11 +08:00
])