feat: add support for checking for attributes in extendMarkRange
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
# extendMarkRange
|
||||
The `extendMarkRange` command expands the current selection to encompass the current mark. If the current selection doesn’t have the specified mark, nothing changes.
|
||||
|
||||
<ContentMissing />
|
||||
## Parameters
|
||||
`typeOrName: string | MarkType`
|
||||
|
||||
Name or type of the mark.
|
||||
|
||||
`attributes?: Record<string, any>`
|
||||
|
||||
Optionally, you can specify attributes that the extented mark must contain.
|
||||
|
||||
## Usage
|
||||
```js
|
||||
// Expand selection to link marks
|
||||
editor.commands.extendMarkRange('link')
|
||||
|
||||
// Expand selection to link marks with specific attributes
|
||||
editor.commands.extendMarkRange('link', { href: 'https://google.com' })
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user