HYPERLINK EDIT

Hyperlink-related commands executed via editor.execCommand.

Commands


command - deleteLink

Removes the link at the caret position.

NameTypeDescription
actionNamestringAction name
editor.execCommand('deleteLink');

command - insertLink

Attaches a link to the selected text. With only a caret (no selection), inserts the provided text or URL as a link.

NameTypeDescription
actionNamestringAction name
urlstringLink URL
textstringText to insert
titlestringLink description (title attribute)
targetstringTarget: _blank, _top, _parent, _self
editor.execCommand('insertLink',
  'http://www.synapeditor.com',
  'Go to the Synap Editor homepage',
  'Synap Editor homepage',
  '_blank'
);

command - openLink

Opens the link at the caret position.

NameTypeDescription
actionNamestringAction name
editor.execCommand('openLink');

command - updateLink

Updates the link that matches the given id.

NameTypeDescription
actionNamestringAction name
idstringLink ID
urlstringLink URL
textstringNew text
titlestringLink description (title attribute)
targetstringTarget: _blank, _top, _parent, _self
editor.execCommand('updateLink',
  'se_287be74c-119f',
  'http://www.synapeditor.com',
  'Go to the Synap Editor homepage',
  'Synap Editor homepage',
  '_blank'
);