Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@pulsedotso/quill-magic-url
Advanced tools
Checks for URLs during typing and pasting and automatically converts them to links.
Checks for URLs 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.
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]+)|(mailto:[\S]+)|(tel:[\S]+)/,
// Regex used to check URLs on paste
globalRegularExpression: /(https?:\/\/|www\.|mailto:|tel:)[\S]+/g
}
}
});
Regex used to check for URLs during typing.
Default: /(https?:\/\/[\S]+)|(www.[\S]+)/
Example with custom Regex
magicUrl: {
urlRegularExpression: /(https?:\/\/[\S]+)|(www.[\S]+)|(mailto:[\S]+)|(tel:[\S]+)/
}
Regex used to check for URLs on paste.
Default: /(https?:\/\/|www\.)[\S]+/g
Example with custom Regex
magicUrl: {
globalRegularExpression: /(https?:\/\/|www\.|mailto:|tel:)[\S]+/g
}
Regex used to check for URLs to be normalized.
Default: /(https?:\/\/[\S]+)|(www.[\S]+)/
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.
The npm package @pulsedotso/quill-magic-url receives a total of 0 weekly downloads. As such, @pulsedotso/quill-magic-url popularity was classified as not popular.
We found that @pulsedotso/quill-magic-url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.