mdTextCompiler function
String
mdTextCompiler(
- String originalText, {
- bool isUseQQPackage = false,
- bool isUseTencentCloudChatPackage = false,
- List<
CustomEmojiFaceData> customEmojiStickerList = const [],
Implementation
String mdTextCompiler(String originalText, {
bool isUseQQPackage = false,
bool isUseTencentCloudChatPackage = false,
List<CustomEmojiFaceData> customEmojiStickerList = const [],
}) {
String text = originalText;
final EmojiUtil emojiUtil = EmojiUtil(
isUseTencentCloudChatPackage: isUseTencentCloudChatPackage,
isUseQQPackage: isUseQQPackage,
customEmojiStickerList: customEmojiStickerList);
text = text.replaceAllMapped(emojiExp, (match) {
String key = match.group(0)!;
// Check if the emoji exists in the emoji map
if (emojiUtil.emojiMap.containsKey(key)) {
String assetPath = emojiUtil.emojiMap[key]!;
return '';
}
return key;
});
return text;
}