Show: Inherited Protected Private Deprecated

# CKEDITOR.Link Class

Defined in: `src/core/link.js:6`

Link class utility. Provides methods for create, delete and update links.

## Constructor

### `CKEDITOR.Link`

(

- `editor`

)

Defined in `src/core/link.js:6`

#### Parameters:

- `editor` Object

  The CKEditor instance.

## Index

### Methods

- _getCompleteURI
- advanceSelection
- create
- getFromSelection
- remove
- update

## Methods

### `_getCompleteURI`

(

- `URI`

)
String protected

Defined in `src/core/link.js:197`

Checks if the URI has a scheme. If not, the default 'http' scheme with hierarchical path '//' is added to it.

#### Parameters:

- `URI` String

  The URI of the link.

#### Returns:

String:

The URI updated with the protocol.

### `advanceSelection`

(

- `link`

)

Defined in `src/core/link.js:21`

Advances the editor selection to the next available position after a given link or the one in the current selection.

#### Parameters:

- `link` CKEDITOR.dom.element

  The link element which link style should be removed.

### `create`

(

- `URI`
- `attrs`
- `modifySelection`

)

Defined in `src/core/link.js:51`

Create a link with given URI as href.

#### Parameters:

- `URI` String

  The URI of the link.

- `attrs` Object

  A config object with link attributes. These might be arbitrary DOM attributes.

- `modifySelection` Object

  A config object with an advance attribute to indicate if the selection should be moved after the link creation.

### `getFromSelection`

() CKEDITOR.dom.element

Defined in `src/core/link.js:92`

Retrieves a link from the current selection.

#### Returns:

CKEDITOR.dom.element:

The retrieved link or null if not found.

### `remove`

(

- `link`
- `modifySelection`

)

Defined in `src/core/link.js:118`

Removes a link from the editor.

#### Parameters:

- `link` CKEDITOR.dom.element

  The link element which link style should be removed.

- `modifySelection` Object

  A config object with an advance attribute to indicate if the selection should be moved after the link creation.

### `update`

(

- `attrs`
- `link`
- `modifySelection`

)

Defined in `src/core/link.js:152`

Updates the href of an already existing link.

#### Parameters:

- `attrs` Object | String

  The attributes to update or remove. Attributes with null values will be removed.

- `link` CKEDITOR.dom.element

  The link element which href should be removed.

- `modifySelection` Object

  A config object with an advance attribute to indicate if the selection should be moved after the link creation.