@lu-jiejie/markdown-it-magic-link
v0.2.3
Published
Makes links and `@mentions` in markdown beautiful and interactive.
Readme
markdown-it-magic-link
Makes links and @mentions in markdown beautiful and interactive.
This is a fork of antfu/markdown-it-magic-link with additional platform-specific mention support.
New Features
Platform-specific @mentions
In addition to the original GitHub @mentions ({@username}), this fork adds support for custom platform mentions using the format {@platform:username}.
Configuration
import MarkdownItMagicLink from '@lu-jiejie/markdown-it-magic-link'
import MarkdownIt from 'markdown-it'
const md = MarkdownIt()
md.use(MarkdownItMagicLink, {
platformUsers: {
bilibili: {
'lu-jiejie': {
link: 'https://space.bilibili.com/123456',
avatarUrl: 'https://i0.hdslb.com/bfs/face/avatar.jpg',
displayName: 'Lu Jiejie' // optional
}
},
twitter: {
someone: {
link: 'https://twitter.com/someone',
avatarUrl: 'https://pbs.twimg.com/avatar.jpg'
}
}
}
})Usage
Check out {@bilibili:lu-jiejie}
Follow me on {@twitter:someone}
Custom display: {@bilibili:lu-jiejie|My Display Name}