docs: update content
This commit is contained in:
@@ -34,4 +34,4 @@ An optional writing assitance could help people writing content semanticly corre
|
||||
|
||||
TODO: Update resources to point to WCAG 3.0 https://www.w3.org/TR/wcag-3.0/
|
||||
|
||||
Anything we should add here? Please let us know, so we can take it into account.
|
||||
Anything we should add here? [Please let us know](mailto:humans@tiptap.dev), so we can take it into account.
|
||||
|
||||
@@ -8,6 +8,7 @@ You can build your own extensions from scratch with the `Node`, `Mark`, and `Ext
|
||||
And if everything is working fine, don’t forget to [share it with the community](https://github.com/ueberdosis/tiptap/issues/819).
|
||||
|
||||
### Create a node
|
||||
|
||||
```js
|
||||
import { Node } from '@tiptap/core'
|
||||
|
||||
|
||||
@@ -128,8 +128,10 @@ If you’re migrating existing content to tiptap we would recommend to get your
|
||||
|
||||
We’re about to go through a few cases to help with that, for example we provide a PHP package to convert HTML to a compatible JSON structure: [ueberdosis/prosemirror-to-html](https://github.com/ueberdosis/html-to-prosemirror).
|
||||
|
||||
Share your experiences with us! We’d like to add more information here.
|
||||
[Share your experiences with us!](mailto:humans@tiptap.dev) We’d like to add more information here.
|
||||
|
||||
## Security
|
||||
There’s no reason to use on or the other because of security concerns.
|
||||
|
||||
There’s no reason to use on or the other for security reasons.
|
||||
### Validation
|
||||
Always validate user input sent to an API. Attackers don’t need to use tiptap to send malicious HTML or JSON to an API endpoint.
|
||||
|
||||
@@ -7,11 +7,13 @@ The whole tiptap is code base is written in TypeScript. If you haven’t heard o
|
||||
|
||||
TypeScript extends JavaScript by adding types (hence the name). It adds new syntax, which doesn’t exist in plain JavaScript. It’s actually removed before running in the browser, but this step – the compilation – is important to find bugs early. It checks if you passe the right types of data to functions. For a big and complex project, that’s very valuable. It means we’ll get notified of lot of bugs, before shipping code to you.
|
||||
|
||||
Anyway, if you don’t use TypeScript in your project, that’s fine. You’ll still be able to use tiptap and even get a really nice autocomplete for the tiptap API (if your editor supports it, but most do).
|
||||
**Anyway, if you don’t use TypeScript in your project, that’s fine.** You will still be able to use tiptap and nevertheless get a nice autocomplete for the tiptap API (if your editor supports it, but most do).
|
||||
|
||||
If you’re using TypeScript in your project and want to extend tiptap, there are two things that are good to know.
|
||||
If you are using TypeScript in your project and want to extend tiptap, there are two types that are good to know about.
|
||||
|
||||
## Options type
|
||||
## Types
|
||||
|
||||
### Options types
|
||||
To extend or create default options for an extension, you’ll need to define a custom type, here is an example:
|
||||
|
||||
```ts
|
||||
@@ -28,7 +30,7 @@ const CustomExtension = Extension.create({
|
||||
})
|
||||
```
|
||||
|
||||
## Command type
|
||||
### Command type
|
||||
The core package also exports a `Command` type, which needs to be added to all commands that you specify in your code. Here is an example:
|
||||
|
||||
```ts
|
||||
|
||||
Reference in New Issue
Block a user