add the documentation for the hardbreak extension
This commit is contained in:
5
docs/src/demos/Extensions/HardBreak/index.spec.js
Normal file
5
docs/src/demos/Extensions/HardBreak/index.spec.js
Normal file
@@ -0,0 +1,5 @@
|
||||
context('/api/extensions/hard-break', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/api/extensions/hard-break')
|
||||
})
|
||||
})
|
||||
55
docs/src/demos/Extensions/HardBreak/index.vue
Normal file
55
docs/src/demos/Extensions/HardBreak/index.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<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'
|
||||
// import HardBreak from '@tiptap/extension-hard-break'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
EditorContent,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
editor: null,
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.editor = new Editor({
|
||||
extensions: [
|
||||
Document(),
|
||||
Paragraph(),
|
||||
Text(),
|
||||
// HardBreak(),
|
||||
],
|
||||
content: `
|
||||
<p>
|
||||
This<br>
|
||||
is<br>
|
||||
a<br>
|
||||
single<br>
|
||||
paragraph<br>
|
||||
with<br>
|
||||
line<br>
|
||||
breaks.
|
||||
</p>
|
||||
`,
|
||||
})
|
||||
|
||||
window.editor = this.editor
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.editor.destroy()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,9 +1,18 @@
|
||||
# HardBreak
|
||||
Enables you to use the `<br>` HTML tag in the editor.
|
||||
The HardBreak extensions adds support for the `<br>` HTML tag, which forces a line break.
|
||||
|
||||
## Options
|
||||
*None*
|
||||
|
||||
## Commands
|
||||
*None*
|
||||
|
||||
## Keyboard shortcuts
|
||||
* `Command` + `Enter`
|
||||
* `Shift` + `Enter`
|
||||
* Windows & Linux: `Shift` + `Enter`
|
||||
* macOS: `Command` + `Enter`
|
||||
|
||||
## Source Code
|
||||
[packages/extension-hard-break/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-hard-break/)
|
||||
|
||||
## Usage
|
||||
<demo name="Extensions/HardBreak" highlight="13,32" />
|
||||
|
||||
Reference in New Issue
Block a user