class singleton

## Properties

• ### emptyAnchorFix : BooleanCKEDITOR.plugins.link#emptyAnchorFix

For browsers that have editing issues with an empty anchor.

• ### fakeAnchor : BooleanCKEDITOR.plugins.link#fakeAnchor

Opera and WebKit do not make it possible to select empty anchors. Fake elements must be used for them.

Defaults to true

• ### synAnchorSelector : BooleanCKEDITOR.plugins.link#synAnchorSelector

For browsers that do not support CSS3 a[name]:empty(). Note that IE9 is included because of https://dev.ckeditor.com/ticket/7783.

## Methods

• ### getEditorAnchors( editor ) → element[]CKEDITOR.plugins.link#getEditorAnchors

since 4.3.3

Collects anchors available in the editor (i.e. used by the Link plugin). Note that the scope of search is different for inline (the "global" document) and classic (iframe-based) editors (the "inner" document).

#### Parameters

editor : editor

#### Returns

element[]

An array of anchor elements.

• ### getLinkAttributes( editor, data ) → ObjectCKEDITOR.plugins.link#getLinkAttributes

since 4.4.0

Converts link data produced by parseLinkAttributes into an object which consists of attributes to be set (with their values) and an array of attributes to be removed. This method can be used to compose or to update any link element with the given data.

#### Parameters

editor : editor
data : Object

#### Returns

Object

An object consisting of two keys, i.e.:

{
// Attributes to be set.
set: {
href: 'http://foo.bar',
target: 'bang'
},
// Attributes to be removed.
removed: [
'id', 'style'
]
}

• Get the surrounding link element of the current selection.

CKEDITOR.plugins.link.getSelectedLink( editor );

// The following selections will all return the link element.

<a href="#">li^nk</a>
<a href="#">li[nk</a>]
[<b><a href="#">li]nk</a></b>]
[<a href="#"><b>li]nk</b></a>


#### Parameters

editor : editor
[ returnMultiple ] : Boolean

Indicates whether the function should return only the first selected link or all of them.

Defaults to false

#### Returns

element | element[] | null

A single link element or an array of link elements relevant to the current selection.

• ### parseLinkAttributes( editor, element ) → ObjectCKEDITOR.plugins.link#parseLinkAttributes

since 4.4.0

Parses attributes of the link element and returns an object representing the current state (data) of the link. This data format is a plain object accepted e.g. by the Link dialog window and getLinkAttributes.

Note: Data model format produced by the parser must be compatible with the Link plugin dialog because it is passed directly to CKEDITOR.dialog.setupContent.

#### Parameters

editor : editor
element : element

#### Returns

Object

• ### showDisplayTextForElement( element, editor ) → BooleanCKEDITOR.plugins.link#showDisplayTextForElement

since 4.5.11

Determines whether an element should have a "Display Text" field in the Link dialog.

#### Parameters

element : element | null

Selected element, null if none selected or if a ranged selection is made.

editor : editor

The editor instance for which the check is performed.

#### Returns

Boolean
• ### tryRestoreFakeAnchor( editor, element ) → elementCKEDITOR.plugins.link#tryRestoreFakeAnchor

Returns an element representing a real anchor restored from a fake anchor.

#### Parameters

editor : editor
element : element

#### Returns

element

Restored anchor element or nothing if the passed element was not a fake anchor.