Skip to content

Vizel API / core/src / createVizelLinkExtension

Function: createVizelLinkExtension()

ts
function createVizelLinkExtension(options?): Mark<LinkOptions, any>;

Defined in: packages/core/src/extensions/link.ts:55

Create a link extension for Vizel editor.

Parameters

ParameterType
optionsVizelLinkOptions

Returns

Mark&lt;LinkOptions, any&gt;

Example

ts
const editor = new Editor({
  extensions: [
    createVizelLinkExtension({
      openOnClick: true,
      autolink: true,
    }),
  ],
});

// Add a link
editor.chain().focus().setLink({ href: 'https://example.com' }).run();

// Remove a link
editor.chain().focus().unsetLink().run();

Released under the MIT License.