/*! * Jodit Editor (https://xdsoft.net/jodit/) * Released under MIT see LICENSE.txt in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net */ /** * @module plugins/link */ import type { IJodit, IUIForm, IUIOption } from "../../types/index"; declare module 'jodit/config' { interface Config { link: { /** * Template for the link dialog form */ formTemplate: (editor: IJodit) => string | HTMLElement | IUIForm; formClassName?: string; /** Content field format in the link form. Default: text. */ contentMode: 'text' | 'html'; /** * Follow link address after dblclick */ followOnDblClick: boolean; /** * Replace inserted youtube/vimeo link to `iframe` */ processVideoLink: boolean; /** * Wrap inserted link */ processPastedLink: boolean; /** * Link an address when the space, Enter or Tab after it is typed: * one with a scheme (`https://…`), one that starts with `www.` or a * bare domain such as `example.com` or `education.govt.nz`, which * get `https://`, or an email address, which gets `mailto:`. * Punctuation that ends a sentence stays outside the link, and * Backspace or Undo straight after takes the link off. Not inside a * link, `
` or ``. Default: false.
*/
processTypedLink: boolean;
/**
* With `processTypedLink`, more endings a bare domain links with,
* in lower case and without the dot, as `['gle', 'school']` for
* `forms.gle` and `example.school`. Built in are every two-letter
* ending, such as `nz` and `io`, and the generic ones of at least 1
* in 1,000 of the most visited sites, such as `com`, `org`, `edu`
* and `app`. IANA lists them all:
* https://data.iana.org/TLD/tlds-alpha-by-domain.txt
* Default: `[]`.
*/
typedLinkTlds: string[];
/**
* With `processTypedLink`, the endings a bare domain doesn't link
* with, as they're more often a file's: `photos.zip`, `README.md`,
* even when `typedLinkTlds` has them. In lower case, without the
* dot. A plain list replaces this one entry by entry from the
* start, so use `Jodit.atom` to replace the whole list.
* `Jodit.atom([])` lets every ending link.
* Default: `['zip', 'mov', 'md', 'py', 'sh', 'pub']`.
*/
typedLinkFileEndings: string[];
/**
* When opening the link dialog for a new link with an empty URL field,
* pre-fill it from the selected text if that text looks like a URL or
* an email address (`example.com` → `https://example.com`,
* `user@site.com` → `mailto:user@site.com`). Plain text that is not a
* URL/email is left untouched. Default: false.
*/
deriveUrlFromText: boolean;
/**
* Show `no follow` checkbox in link dialog.
*/
noFollowCheckbox: boolean;
/**
* Show `Open in new tab` checkbox in link dialog.
*/
openInNewTabCheckbox: boolean;
/**
* Default value for the `Open in new tab` checkbox when inserting a new link.
*/
openInNewTabCheckboxDefaultChecked: boolean;
/**
* Show an `aria-label` text input in the link dialog so an
* accessible name can be set on the `` (useful when several
* links share the same visible text, e.g. "here"). Default: false.
*/
ariaLabelInput: boolean;
/**
* Use an input text to ask the classname or a select or not ask
*/
modeClassName: 'input' | 'select';
/**
* Allow multiple choises (to use with modeClassName="select")
*/
selectMultipleClassName: boolean;
/**
* The size of the select (to use with modeClassName="select")
*/
selectSizeClassName?: number;
/**
* The list of the option for the select (to use with modeClassName="select")
*/
selectOptionsClassName: IUIOption[];
/**
* With modeClassName="select", keep the link's classes that the list
* doesn't offer, such as one an integration gives some of its links,
* and change only the listed ones. Off, the form sets the link's
* classes to the selected ones alone
*/
selectKeepOtherClassNames: boolean;
hotkeys: string[];
/**
* Prevent navigation to the link if it is readonly. Default: true
*/
preventReadOnlyNavigation: boolean;
};
}
}