---
title: "extendMarkRange command"
description: "Use the extendMarkRange command in Tiptap to expand the current selection to include the specified mark. Learn more in our docs!"
canonical_url: "https://tiptap.dev/docs/editor/api/commands/nodes-and-marks/extend-mark-range"
---

# extendMarkRange command

Use the extendMarkRange command in Tiptap to expand the current selection to include the specified mark. Learn more in our docs!

The `extendMarkRange` command expands the current selection to encompass the current mark. If the current selection doesn’t have the specified mark, nothing changes.

## Parameters

`typeOrName: string | MarkType`

Name or type of the mark.

`attributes?: Record<string, any>`

Optionally, you can specify attributes that the extended mark must contain.

## Use the extendMarkRange command

```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' })

// Expand selection to link mark and update attributes
editor
  .chain()
  .extendMarkRange('link')
  .updateAttributes('link', {
    href: 'https://duckduckgo.com',
  })
  .run()
```
