add the text extension page

This commit is contained in:
Hans Pagel 2020-09-15 17:05:32 +02:00
parent f8487c95a7
commit 2f9ee7fbbd
4 changed files with 58 additions and 2 deletions

View File

@ -0,0 +1,5 @@
context('/api/extensions/document', () => {
before(() => {
cy.visit('/api/extensions/document')
})
})

View File

@ -0,0 +1,42 @@
<template>
<div v-if="editor">
<editor-content :editor="editor" />
</div>
</template>
<script>
import { Editor } from '@tiptap/core'
import { EditorContent } from '@tiptap/vue'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
extensions: [
Document(),
Paragraph(),
Text(),
],
content: `
<p>The Text extension is required, at least if you want to have text in your text editor and thats very likely.</p>
`,
})
},
beforeDestroy() {
this.editor.destroy()
}
}
</script>

View File

@ -1,2 +1,12 @@
# Text
Enables you to use text in the editor.
**The `Text` extension is required**, at least if you want to work with text of any kind and thats very likely. This extension is a little bit different, it doesnt even render HTML. Its plain text, thats all.
:::warning Breaking Change from 1.x → 2.x
Tiptap 1 tried to hide that node from you, but it has always been there.
:::
## Source Code
[packages/extension-text/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text/)
## Usage
<demo name="Extensions/Text" highlight="12,30" />

View File

@ -172,7 +172,6 @@
# draft: true
- title: Text
link: /api/extensions/text
draft: true
# - title: TodoItem
# link: /api/extensions/todo-item
# draft: true