Skip to main content

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

OptionTypeDefaultDescription
autolink_patternRegExpStandard link regex (case-insensitive)Regular expression used to detect whether the text preceding the cursor is a valid URL.
link_default_targetstringIf set, automatically applies this target attribute (e.g. '_blank') to auto-created links.
link_default_protocolstring'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.