tiptap/docs/src/docPages/api/nodes/paragraph.md

39 lines
1.6 KiB
Markdown
Raw Normal View History

2020-09-02 21:20:35 +08:00
# Paragraph
2021-01-25 17:35:52 +08:00
[![Version](https://img.shields.io/npm/v/@tiptap/extension-paragraph.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-paragraph)
[![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-paragraph.svg)](https://npmcharts.com/compare/@tiptap/extension-paragraph?minimal=true)
Yes, the schema is very strict. Without this extension you wont even be able to use paragraphs in the editor.
2020-09-09 22:12:39 +08:00
2020-09-23 18:03:03 +08:00
:::warning Breaking Change from 1.x → 2.x
2020-10-30 23:13:47 +08:00
tiptap 1 tried to hide that node from you, but it has always been there. You have to explicitly import it from now on (or use `defaultExtensions()`).
2020-09-23 18:03:03 +08:00
:::
## Installation
```bash
2020-10-30 21:24:16 +08:00
# with npm
npm install @tiptap/extension-paragraph
2020-10-30 21:24:16 +08:00
# with Yarn
yarn add @tiptap/extension-paragraph
```
2020-09-23 18:03:03 +08:00
## Settings
2020-11-18 19:12:34 +08:00
| Option | Type | Default | Description |
| -------------- | -------- | ------- | --------------------------------------------------------------------- |
| HTMLAttributes | `Object` | `{}` | Custom HTML attributes that should be added to the rendered HTML tag. |
2020-09-09 22:12:39 +08:00
## Commands
| Command | Parameters | Description |
| --------- | ---------- | -------------------------------------------- |
| paragraph | — | Transforms all selected nodes to paragraphs. |
2020-09-09 22:12:39 +08:00
## Keyboard shortcuts
* Windows & Linux: `Control` `Alt` `0`
* macOS: `Cmd` `Alt` `0`
2020-09-09 22:12:39 +08:00
2020-09-21 22:59:28 +08:00
## Source code
2020-09-09 22:12:39 +08:00
[packages/extension-paragraph/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-paragraph/)
## Usage
<demo name="Nodes/Paragraph" highlight="11,29" />