• Exposes the core behavior for linking and unlinking text, and allows for customization of the URL input handler.

    Example

    let myPrompt = (message, defaultURL, promptCallback) => {
    let url = window.prompt("Overriding the defaults", "http://placekitten.com");
    promptCallback(url);
    };

    editor.registerKeyCommand({
    str: "META+K",
    run(editor) {
    toggleLink(editor, myPrompt);
    }
    });
    @public

    Parameters

    • editor: Editor

      An editor instance to operate on. If a range is selected, either prompt for a URL and add a link or un-link the currently linked text.

    • Optional showPrompt: ShowPromptCallback = defaultShowPrompt

      An optional custom input handler. Defaults to using window.prompt.

    Returns void

Generated using TypeDoc