tiptap/packages/html/example.js

25 lines
481 B
JavaScript
Raw Normal View History

2020-09-04 19:44:27 +08:00
import { generateHtml } from '@tiptap/html'
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-09-04 19:44:27 +08:00
const html = generateHtml({
2020-09-24 05:38:11 +08:00
type: 'document',
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
])