import { Emoji, EmojiSyntax, Heading, ImageTag } from './Regex' import Twemoji from 'twemoji' import { KoreanbotsEmoji } from './Constants' export const anchorHeader = { type: 'output', regex: Heading, replace: function (__match: string, id:string, title:string, level:number) { // github anchor style const href = id.replace(ImageTag, '$1').replace(/"/gi, '') const octicon_html = `` return `${octicon_html}${title}` } } export const twemoji = { type: 'output', regex: `${Emoji}{2}|${Emoji}`, replace: function(__match: string, two: string, one: string) { const parsed = __match || two || one const emoj = Twemoji.parse(parsed, { folder: 'svg', ext: '.svg' }) if(!emoj) return parsed return emoj } } export const customEmoji = { type: 'output', regex: EmojiSyntax, replace: function(__match: string, name: string) { if(!name) return `:${name}:` return `${name}` } }