
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@fedify/markdown-it-mention
Advanced tools
A markdown-it plugin that parses and renders Mastodon-style @mentions.
This is a markdown-it plugin that parses and renders Mastodon-style @mentions,
e.g., @username@domain.com
. It converts them to a link, e.g.:
<a href="acct:@username@domain.com"><span class="at">@</span><span
class="user">username</span></a>
The value of href
attributes, other attributes (if any), and the content of
the link can be customized by passing options to the plugin:
import MarkdownIt from "markdown-it";
import { mention, toFullHandle } from "@fedify/markdown-it-mention";
const md = new MarkdownIt();
md.use(mention, {
link: (handle: string, env: any) => `https://example.com/${handle}`,
linkAttributes: (handle: string, env: any) => ({ class: "mention" }),
label: toFullHandle,
});
[!TIP] The
link
callback can returnnull
to disable the link.
If you want to collect all the handles mentioned in the document, you can pass
the environment object to the render()
method:
const env = {};
md.render(
"# Hello, @foo@bar.com\n\n> @baz@qux.com",
env,
);
console.log(env.mentions); // ["@foo@bar.com", "@baz@qux.com"]
deno add jsr:@fedify/markdown-it-mention
npm add @fedify/markdown-it-mention
bun add @fedify/markdown-it-mention
FAQs
A markdown-it plugin that parses and renders Mastodon-style @mentions.
We found that @fedify/markdown-it-mention demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.