tiptap/docs/api/commands/wrap-in-list.md

18 lines
385 B
Markdown
Raw Normal View History

2021-04-21 17:03:33 +08:00
# wrapInList
`wrapInList` will wrap a node in the current selection in a list.
2021-04-21 17:03:33 +08:00
## Parameters
`typeOrName: string | NodeType`
The type of node that should be wrapped in a list.
`attributes?: Record<string, any>`
The attributes that should be applied to the list. **This is optional.**
## Usage
```js
// wrap a paragraph in a bullet list
editor.commands.wrapInList('paragraph')
```