UNPKG

@discord-user-card/markdown

Version:

A markdown parser for Discord

16 lines 471 B
import { defaultRules, htmlTag } from "simple-markdown"; const userMentionRegex = /^<@!?(\d{17,20})>/; export const user = { order: defaultRules.strong.order, match: source => userMentionRegex.exec(source), parse(capture) { return { id: capture[1], type: "user", }; }, html: node => htmlTag("span", htmlTag("span", `@${node.id}`), { class: "duc_user_mention", }), }; //# sourceMappingURL=user.js.map