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
| Parameter | Type |
|---|---|
options | VizelLinkOptions |
Returns
Mark<LinkOptions, any>
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();