Skip to content

Vizel API / core/src / applyVizelLinkEdit

Function: applyVizelLinkEdit() ​

ts
function applyVizelLinkEdit(
   editor, 
   params, 
   canEmbed
): string;

Defined in: packages/core/src/builders/link-editor.ts:128

Apply the link-editor submission to the editor.

An empty (trimmed) URL removes the current link. When asEmbed is true and the embed extension is loaded (canEmbed), the link is removed and an embed is inserted instead. Otherwise the link mark is set with the appropriate target.

Parameters ​

ParameterType
editorEditor
paramsVizelLinkSubmitParams
canEmbedboolean

Returns ​

string

The trimmed URL that was applied (empty string when removed).

Released under the MIT License.