This commit is contained in:
Philipp Kühn 2020-09-10 11:43:19 +02:00
commit 709c10697c
19 changed files with 89 additions and 20 deletions

View File

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

View 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>

View File

@ -11,7 +11,7 @@ The Blockquote extension enables you to use the `<blockquote>` HTML tag in the e
| ---------- | ------- | ----------------------------- | | ---------- | ------- | ----------------------------- |
| blockquote | — | Wrap content in a blockquote. | | blockquote | — | Wrap content in a blockquote. |
## Keybindings ## Keyboard shortcuts
* `Control` + `→` * `Control` + `→`
## Usage ## Usage

View File

@ -17,7 +17,7 @@ The extension will generate the corresponding `<strong>` HTML tags when reading
| ------- | ------- | --------------- | | ------- | ------- | --------------- |
| bold | — | Mark text bold. | | bold | — | Mark text bold. |
## Keybindings ## Keyboard shortcuts
* Windows & Linux: `Control` + `B` * Windows & Linux: `Control` + `B`
* macOS: `Command` + `B` * macOS: `Command` + `B`

View File

@ -15,7 +15,7 @@ Its intended to be used with the `ListItem` extension.
| ----------- | ------- | --------------------- | | ----------- | ------- | --------------------- |
| bullet_list | — | Toggle a bullet list. | | bullet_list | — | Toggle a bullet list. |
## Keybindings ## Keyboard shortcuts
* `Control` + `Shift` + `8` * `Control` + `Shift` + `8`
## Usage ## Usage

View File

@ -7,5 +7,5 @@ Enables you to use the `<pre>` HTML tag with auto-detected syntax highlighting i
## Commands ## Commands
*None* *None*
## Keybindings ## Keyboard shortcuts
*None* *None*

View File

@ -7,5 +7,5 @@ Enables you to use the `<pre>` HTML tag in the editor.
## Commands ## Commands
*None* *None*
## Keybindings ## Keyboard shortcuts
*None* *None*

View File

@ -11,7 +11,7 @@ The Code extensions enables you to use the `<code>` HTML tag in the editor. If y
| ------- | ------- | ------------------------- | | ------- | ------- | ------------------------- |
| code | — | Mark text as inline code. | | code | — | Mark text as inline code. |
## Keybindings ## Keyboard shortcuts
* `Alt` + ` * `Alt` + `
## Source Code ## Source Code

View File

@ -1,9 +1,18 @@
# HardBreak # 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 ## Options
*None* *None*
## Keybindings ## Commands
* `Command` + `Enter` *None*
* `Shift` + `Enter`
## Keyboard shortcuts
* 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" />

View File

@ -12,7 +12,7 @@ Enables you to use headline HTML tags in the editor.
| ------- | ------- | ----------------------- | | ------- | ------- | ----------------------- |
| heading | level | Creates a heading node. | | heading | level | Creates a heading node. |
## Keybindings ## Keyboard shortcuts
* `Control` + `Shift` + `1` → H1 * `Control` + `Shift` + `1` → H1
* `Control` + `Shift` + `2` → H2 * `Control` + `Shift` + `2` → H2
* `Control` + `Shift` + `3` → H3 * `Control` + `Shift` + `3` → H3

View File

@ -10,7 +10,7 @@ This extension provides history support. All changes to the document will be tra
| undo | — | Undo the last change. | | undo | — | Undo the last change. |
| redo | — | Redo the last change. | | redo | — | Redo the last change. |
## Keybindings ## Keyboard shortcuts
* Windows & Linux: `Control` + `Z` * Windows & Linux: `Control` + `Z`
* macOS: `Command` + `Z` * macOS: `Command` + `Z`

View File

@ -11,7 +11,7 @@ Enables you to use the `<hr>` HTML tag in the editor.
| --------------- | ------- | ------------------------- | | --------------- | ------- | ------------------------- |
| horizontal_rule | — | Create a horizontal rule. | | horizontal_rule | — | Create a horizontal rule. |
## Keybindings ## Keyboard shortcuts
*None* *None*
## Usage ## Usage

View File

@ -15,7 +15,7 @@ The extension will generate the corresponding `<em>` HTML tags when reading cont
| ------- | ------- | ----------------- | | ------- | ------- | ----------------- |
| italic | — | Mark text italic. | | italic | — | Mark text italic. |
## Keybindings ## Keyboard shortcuts
* Windows & Linux: `Control` + `I` * Windows & Linux: `Control` + `I`
* macOS: `Command` + `I` * macOS: `Command` + `I`

View File

@ -15,7 +15,7 @@ This extensions is intended to be used with the `ListItem` extension.
| ------------ | ------- | ----------------------- | | ------------ | ------- | ----------------------- |
| ordered_list | — | Toggle an ordered list. | | ordered_list | — | Toggle an ordered list. |
## Keybindings ## Keyboard shortcuts
* `Control` + `Shift` + `9` * `Control` + `Shift` + `9`
## Usage ## Usage

View File

@ -9,7 +9,7 @@ Yes, the schema is very strict. Without this extension you wont even be able
## Commands ## Commands
*None* *None*
## Keybindings ## Keyboard shortcuts
*None* *None*
## Source Code ## Source Code

View File

@ -11,7 +11,7 @@ Enables you to use the `<s>` HTML tag in the editor.
| ------- | ------- | --------------------------- | | ------- | ------- | --------------------------- |
| strike | — | Mark text as strikethrough. | | strike | — | Mark text as strikethrough. |
## Keybindings ## Keyboard shortcuts
* Windows & Linux: `Control` + `D` * Windows & Linux: `Control` + `D`
* macOS: `Command` + `D` * macOS: `Command` + `D`

View File

@ -13,5 +13,5 @@ This extensions is intended to be used with the `TodoList` extension.
## Commands ## Commands
*None* *None*
## Keybindings ## Keyboard shortcuts
*None* *None*

View File

@ -13,7 +13,7 @@ This extensions is intended to be used with the `TodoItem` extension.
| --------- | ------- | ----------------- | | --------- | ------- | ----------------- |
| todo_list | — | Toggle todo list. | | todo_list | — | Toggle todo list. |
## Keybindings ## Keyboard shortcuts
*None* *None*
## Usage ## Usage

View File

@ -11,7 +11,7 @@ Enables you to use the `<u>` HTML tag in the editor.
| --------- | ------- | ------------------------ | | --------- | ------- | ------------------------ |
| underline | — | Mark text as underlined. | | underline | — | Mark text as underlined. |
## Keybindings ## Keyboard shortcuts
* Windows & Linux: `Control` + `U` * Windows & Linux: `Control` + `U`
* macOS: `Command` + `U` * macOS: `Command` + `U`