Autolink
Plugin alias: autolink
editor42.init({
plugins: 'autolink'
});
Automatically converts typed URLs into clickable hyperlinks as the user types. Detects URLs when the user presses Space, Enter, or a closing bracket character, then wraps the detected text in an anchor element. Supports configurable URL patterns and default link targets/protocols.
Options
| Option | Type | Default | Description |
|---|---|---|---|
autolink_pattern | RegExp | Standard link regex (case-insensitive) | Regular expression used to detect whether the text preceding the cursor is a valid URL. |
link_default_target | string | — | If set, automatically applies this target attribute (e.g. '_blank') to auto-created links. |
link_default_protocol | string | 'https' | Protocol prepended to URLs that start with www. |
This plugin also reads the core option allow_unsafe_link_target to decide whether to add rel="noopener" for _blank targets.