Skip to main content

insert-link

Description

Fires when inserting link

Usage

"insert-link": ({ url: string }) => boolean | void;

Parameters

The callback of the update-link event can take an object with the following parameter:

  • url - the url to be inserted
info

For handling inner events you can use Event Bus methods

Example

// initialize RichText
const editor = new richtext.Richtext("#root", {
// configuration properties
});
// subscribe to the "insert-link" event
editor.api.on("insert-link", (obj) => {
console.log(obj)
console.log("The following link was inserted: " + obj.url);
});

Change log: The event was added in v2.0