
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
quill-magic-url
Advanced tools
Checks for URLs during typing and pasting and automatically converts them to links.
Checks for URLs and mail addresses during typing and pasting and automatically converts them to links and normalizes the links URL.
Thanks to @LFDM for the groundwork with quill-auto-links.
You can find a demo page here.

<!-- After quill script includes -->
<script src="https://unpkg.com/quill-magic-url@3.0.0/dist/index.js"></script>
npm install quill-magic-url --save
import Quill from 'quill'
import MagicUrl from 'quill-magic-url'
Quill.register('modules/magicUrl', MagicUrl)
Basic usage with default options:
const quill = new Quill(editor, {
modules: {
magicUrl: true,
},
})
Usage with custom options:
const quill = new Quill(editor, {
modules: {
magicUrl: {
// Regex used to check URLs during typing
urlRegularExpression: /(https?:\/\/[\S]+)|(www.[\S]+)|(tel:[\S]+)/g,
// Regex used to check URLs on paste
globalRegularExpression: /(https?:\/\/|www\.|tel:)[\S]+/g,
},
},
})
Regex used to check for URLs during typing.
Default: /(https?:\/\/|www\.)[\w-\.]+\.[\w-\.]+(\/([\S]+)?)?/gi
Example with custom Regex
magicUrl: {
urlRegularExpression: /(https?:\/\/[\S]+)|(www.[\S]+)|(tel:[\S]+)/g
}
Regex used to check for URLs on paste.
Default: /(https?:\/\/|www\.)[\w-\.]+\.[\w-\.]+(\/([\S]+)?)?/gi
Example with custom Regex
magicUrl: {
globalRegularExpression: /(https?:\/\/|www\.|tel:)[\S]+/g
}
Regex used to check for mail addresses during typing. Set to
nullto disable conversion of mail addresses.
Default: /([\w-\.]+@[\w-\.]+\.[\w-\.]+)/gi
Example with custom Regex
magicUrl: {
mailRegularExpression: /([\w-\.]+@[\w-\.]+\.[\w-\.]+)/gi
}
Regex used to check for mail addresses on paste. Set to
nullto disable conversion of mail addresses.
Default: /([\w-\.]+@[\w-\.]+\.[\w-\.]+)/gi
Example with custom Regex
magicUrl: {
globalMailRegularExpression: /([\w-\.]+@[\w-\.]+\.[\w-\.]+)/gi
}
Regex used to check for URLs to be normalized.
Default: /(https?:\/\/|www\.)[\S]+/i
You will most likely want to keep this options default value.
Options for normalizing the URL
Default:
{
stripWWW: false
}
Example with custom options
magicUrl: {
normalizeUrlOptions: {
stripHash: true,
stripWWW: false,
normalizeProtocol: false
}
}
Available options
We use normalize-url for normalizing URLs. You can find a detailed description of the possible options here.
For some advanced URL Regex check this out.
FAQs
Checks for URLs during typing and pasting and automatically converts them to links.
We found that quill-magic-url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.