Linkify

Plugin for converting URL-like text into links.

The comark/plugins/linkify plugin converts URLs such as https://comark.dev and emails such as hi@comark.dev into links, using linkify-it. Domains without a scheme, such as www.example.com, are linked only with fuzzyLink.

The plugin is enabled by default via registerDefaultPlugins. No installation or registration required.

import { parseMarkdown } from 'comark'

await parseMarkdown('Read https://comark.dev')

Explicit registration is only needed when default plugins are disabled, or with comark/core. List it before markdown-it plugins that call md.linkify.add():

import { parseMarkdown } from 'comark'
import linkify from 'comark/plugins/linkify'
import components from 'comark/plugins/components'

const result = await parseMarkdown(content, {
  registerDefaultPlugins: false,
  plugins: [linkify(), components()],
})

Options

linkify() accepts linkify-it's recognition options. Pass a configured linkify() in plugins to replace the default:

import { parseMarkdown } from 'comark'
import linkify from 'comark/plugins/linkify'

await parseMarkdown('Visit www.example.com', {
  plugins: [linkify({ fuzzyLink: true })],
})
OptionTypeDefaultDescription
fuzzyLinkbooleanfalseLink domains without a scheme, such as www.example.com or example.com. Slower on long text
fuzzyEmailbooleantrueLink emails without mailto:
fuzzyIPbooleanfalseAllow IP addresses in fuzzy links. Can match version numbers
urlAuthbooleanfalseLink URLs that contain credentials, such as https://user:pass@example.com
tldsstring[]linkify-it's listTop-level domains allowed in fuzzy links. Replaces the default list
maxLengthnumber10000Maximum link length
'---'booleanfalseEnd a link at ---, treating it as a long dash
Before linkify-it 6, Comark linked www.example.com and user:pass@ URLs by default. Pass linkify({ fuzzyLink: true, urlAuth: true }) to keep that behavior.
The linkify parser option is deprecated. It logs a warning and will be removed in a future major version. Replace linkify: false with registerDefaultPlugins: false, then register only the default plugins you need.
© 2026 Vercel, Inc.