mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-29 06:15:29 -04:00
Add Emoji/FA Autocompletion (#387)
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>
This commit is contained in:
parent
c8c5569426
commit
c15f0d9900
13 changed files with 279 additions and 38 deletions
15
src/utils/emoji.ts
Normal file
15
src/utils/emoji.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue