This package is a unified (remark) plugin to convert @ mentions to links: @wooorm
-> [**@wooorm**](https://github.com/wooorm)
.
unified is a project that transforms content with abstract syntax trees (ASTs). remark adds support for markdown to unified. mdast is the markdown AST that remark uses. This is a remark plugin that transforms mdast.
npm install remark-mentions
import {remark} from 'remark'
import remarkMentions from 'remark-mentions'
const markdown = "Hello @user!";
const file = await remark()
.use(remarkMentions, {
usernameLink: (username) => `/User/Profile/${username}`, // This is optional
})
.process(markdown)
console.log(String(file))