Skip to main content
Home

Built and signed on GitHub Actions

A markdown-it plugin that parses and renders Mastodon-style @mentions

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
8 months ago (0.3.0)
interface PluginOptions

Options for the plugin.

Properties

optional
localDomain: (
bareHandle: string,
env: any,
) => string | null

A function to determine the domain of a bare handle. If it returns null, the bare handle will be rendered as plain text. null by default.

optional
linkAttributes: (
handle: string,
env: any,
) => Record<string, string>

A function to render extra attributes for a mention link.

optional
label: (
handle: string,
env: any,
) => string

A function to render a label for a mention link. toBareHandle by default.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fedify/markdown-it-mention

Import symbol

import { type PluginOptions } from "@fedify/markdown-it-mention";
or

Import directly with a jsr specifier

import { type PluginOptions } from "jsr:@fedify/markdown-it-mention";

Add Package

pnpm i jsr:@fedify/markdown-it-mention
or (using pnpm 10.8 or older)
pnpm dlx jsr add @fedify/markdown-it-mention

Import symbol

import { type PluginOptions } from "@fedify/markdown-it-mention";

Add Package

yarn add jsr:@fedify/markdown-it-mention
or (using Yarn 4.8 or older)
yarn dlx jsr add @fedify/markdown-it-mention

Import symbol

import { type PluginOptions } from "@fedify/markdown-it-mention";

Add Package

vlt install jsr:@fedify/markdown-it-mention

Import symbol

import { type PluginOptions } from "@fedify/markdown-it-mention";

Add Package

npx jsr add @fedify/markdown-it-mention

Import symbol

import { type PluginOptions } from "@fedify/markdown-it-mention";

Add Package

bunx jsr add @fedify/markdown-it-mention

Import symbol

import { type PluginOptions } from "@fedify/markdown-it-mention";