Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
delta-detect-links
Advanced tools
Detect links in a delta object.
This small library is based on linkify-it
to detect links in a rich text Delta
object.
The main purpose for this library is to automatically detect links in Quill documents.
detectLinks
This function detects all links in the given insert
-only delta object.
const detectLinks = require('delta-detect-links');
detectLinks((new Delta()).insert('Visit www.example.com\n'));
// → [ { insert: 'Visit ' }, { insert: 'www.example.com', attributes: { link: 'http://www.example.com' } }, { insert: '\n' } ]
Already existing links in the given delta object will be skipped and not highlighted a second time.
detectLinks
supports an optional second parameter to set the following options:
skipTrailingMatch
(default: false
): This is useful when you want to detect links in real-time while the user types. In order to prevent detection of partial links the link will only be detected after another stop word has been encountered.lastIndex
: This option is only used in combination with skipTrailingMatch
. This value is used to determine the trailing match. It is useful in scenarios where the current cursor is not at the same position as the end of the document.detectLinksDelta
Similar to detectLinks
but only contains the changes delta object.
const detectLinksDelta = require('delta-detect-links').detectLinksDelta;
detectLinksDelta((new Delta()).insert('Visit www.example.com\n'));
// → [ { retain: 6 }, { retain: 15, attributes: { link: 'http://www.example.com' } } ]
FAQs
Detect links in a delta object.
The npm package delta-detect-links receives a total of 49 weekly downloads. As such, delta-detect-links popularity was classified as not popular.
We found that delta-detect-links 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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.