Update utils/ShowdownExtensions.ts

Co-authored-by: zero734kr <zero734kr@gmail.com>
This commit is contained in:
Junseo Park 2021-04-28 19:24:56 +09:00 committed by GitHub
parent 9d1113d248
commit c190dc2950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ export const anchorHeader = {
export const twemoji = { export const twemoji = {
type: 'output', type: 'output',
regex: `${Emoji}{2}|${Emoji}`, regex: `${Emoji}{1,2}`,
replace: function(__match: string, two: string, one: string) { replace: function(__match: string, two: string, one: string) {
const parsed = __match || two || one const parsed = __match || two || one
const emoj = Twemoji.parse(parsed, { folder: 'svg', ext: '.svg' }) const emoj = Twemoji.parse(parsed, { folder: 'svg', ext: '.svg' })
@ -38,4 +38,4 @@ export const customEmoji = {
if(!name || !result) return `:${name}:` if(!name || !result) return `:${name}:`
return `<img class="emoji special" draggable="false" alt="${name}" src="${result.imageUrl}"/>` return `<img class="emoji special" draggable="false" alt="${name}" src="${result.imageUrl}"/>`
} }
} }