Telegram Web K with changes to work inside I2P
https://web.telegram.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
569 B
16 lines
569 B
/* |
|
* https://github.com/morethanwords/tweb |
|
* Copyright (C) 2019-2021 Eduard Kuzmenko |
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE |
|
*/ |
|
|
|
import {MessageEntity} from '../../layer'; |
|
import parseEntities from './parseEntities'; |
|
import wrapRichText from './wrapRichText'; |
|
|
|
export default function wrapEmojiText(text: string, isDraft = false, entities?: MessageEntity[]) { |
|
if(!text) return wrapRichText(''); |
|
|
|
entities ??= parseEntities(text).filter((e) => e._ === 'messageEntityEmoji'); |
|
return wrapRichText(text, {entities, wrappingDraft: isDraft}); |
|
}
|
|
|