feat: add support for checking for attributes in extendMarkRange

This commit is contained in:
Philipp Kühn
2021-05-17 13:00:54 +02:00
parent 5b8808a899
commit ff7dd9b919
7 changed files with 391 additions and 14 deletions

View File

@@ -1,3 +1,20 @@
# extendMarkRange
The `extendMarkRange` command expands the current selection to encompass the current mark. If the current selection doesnt 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' })
```

View File

@@ -151,7 +151,6 @@
type: draft
- title: extendMarkRange
link: /api/commands/extend-mark-range
type: draft
- title: focus
link: /api/commands/focus
type: draft