add content

This commit is contained in:
Hans Pagel
2020-10-02 21:11:01 +02:00
parent 3774d95b21
commit 548e148549
2 changed files with 3 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
## Table of Contents ## Table of Contents
## Introduction ## Introduction
Lets extend tiptap with a custom extension! One of the strength of tiptap is its extendability. You dont depend on the provided extensions, its intended to extend the editor to your liking. With custom extensions you can add new content types and new functionalities, on top of what already exists or on top of that.
## Option 1: Change defaults ## Option 1: Change defaults

View File

@@ -10,7 +10,7 @@ The whole editor is rendered inside of a container with the class `.ProseMirror`
```css ```css
/* Scoped to the editor */ /* Scoped to the editor */
.ProseMirror p { .ProseMirror p {
margin: 1em 0; margin: 1em 0;
} }
``` ```
@@ -19,7 +19,7 @@ If youre rendering the stored content somewhere, there wont be a `.ProseMi
```css ```css
/* Global styling */ /* Global styling */
p { p {
margin: 1em 0; margin: 1em 0;
} }
``` ```
@@ -29,7 +29,6 @@ p {
Most extensions have a `class` option, which you can use to add a custom CSS class to the HTML tag. Most extensions have a `class` option, which you can use to add a custom CSS class to the HTML tag.
```js ```js
/* Add custom classes */
new Editor({ new Editor({
extensions: [ extensions: [
Document(), Document(),
@@ -55,7 +54,6 @@ The rendered HTML will look like that:
You can even customize the markup for every extension. This will make a custom bold extension that doesnt render a `<strong>` tag, but a `<b>` tag: You can even customize the markup for every extension. This will make a custom bold extension that doesnt render a `<strong>` tag, but a `<b>` tag:
```js ```js
/* Customizing the markup */
import Bold from '@tiptap/extension-bold' import Bold from '@tiptap/extension-bold'
const CustomBold = Bold const CustomBold = Bold