mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 11:37:02 -04:00

added emoji/fork-awesome autocompletion added autocompletion e2e test Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Erik Michelson <github@erik.michelson.eu>
15 lines
470 B
TypeScript
15 lines
470 B
TypeScript
import { BaseEmoji, CustomEmoji, EmojiData } from 'emoji-mart'
|
|
|
|
export const getEmojiIcon = (emoji: EmojiData):string => {
|
|
if ((emoji as BaseEmoji).native) {
|
|
return (emoji as BaseEmoji).native
|
|
} else if ((emoji as CustomEmoji).imageUrl) {
|
|
// noinspection CheckTagEmptyBody
|
|
return `<i class="fa ${(emoji as CustomEmoji).name}"></i>`
|
|
}
|
|
return ''
|
|
}
|
|
|
|
export const getEmojiShortCode = (emoji: EmojiData):string => {
|
|
return (emoji as BaseEmoji).colons
|
|
}
|