Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
remark-external-links
Advanced tools
Package description
The remark-external-links package is a plugin for the Remark Markdown processor that automatically modifies links in Markdown files. It is primarily used to add attributes like target and rel to external links, enhancing security and usability without manual HTML tagging.
Adding attributes to external links
This feature allows users to automatically add specific attributes such as target='_blank' and rel='nofollow noopener noreferrer' to external links in Markdown content. This enhances security by preventing tabnapping and improves SEO through 'nofollow'. The code sample demonstrates how to set up the plugin with Remark to process a simple Markdown string.
const remark = require('remark');
const html = require('remark-html');
const externalLinks = require('remark-external-links');
remark()
.use(externalLinks, {target: '_blank', rel: ['nofollow', 'noopener', 'noreferrer']})
.use(html)
.process('Check out [Google](https://google.com)!', function (err, file) {
console.log(String(file));
});
Similar to remark-external-links, rehype-external-links is a plugin but for Rehype, which processes HTML instead of Markdown. It offers similar functionalities in terms of adding attributes to external links in HTML content, making it a suitable alternative for projects that work directly with HTML rather than Markdown.
This is a plugin for the markdown-it parser, which is another popular Markdown processor. Like remark-external-links, it allows the addition of attributes to external links in Markdown files. The main difference lies in the base Markdown processor (markdown-it vs. remark), which might affect the choice depending on other project dependencies and personal preference for Markdown syntax extensions.
Readme
Stability: Legacy.
This package is no longer recommended for use.
It’s still covered by semantic-versioning guarantees and not yet deprecated,
but use of this package should be avoided.
Please use remark-rehype
to move from remark (markdown) to rehype (HTML)
and then replace remark-external-links
with
rehype-external-links
.
Legacy documentation for this package is still available in Git.
FAQs
Legacy remark plugin to automatically add target and rel attributes to external links — please use `rehype-external-links`
The npm package remark-external-links receives a total of 2,953,855 weekly downloads. As such, remark-external-links popularity was classified as popular.
We found that remark-external-links 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.