fix multiple emojis not being processed correctly
This commit is contained in:
parent
72c83a436c
commit
877f142238
|
@ -14,21 +14,22 @@ export class EmojiConverter {
|
|||
|
||||
if (emojis) {
|
||||
emojis.forEach(emoji => {
|
||||
text = text.replace(
|
||||
`:${emoji.shortcode}:`,
|
||||
`<img class="${className}" src="${emoji.url}" title=":${
|
||||
emoji.shortcode
|
||||
}:" alt=":${emoji.shortcode}:" />`
|
||||
);
|
||||
text = this.replaceAll(text, `:${emoji.shortcode}:`, `<img class="${className}" src="${emoji.url}" title=":${
|
||||
emoji.shortcode }:" alt=":${emoji.shortcode}:" />`)
|
||||
});
|
||||
}
|
||||
|
||||
text = this.emojiOne.toImage(text, className);
|
||||
return text;
|
||||
}
|
||||
|
||||
private replaceAll(str, find, replace) {
|
||||
return str.replace(new RegExp(find, 'g'), replace);
|
||||
}
|
||||
}
|
||||
|
||||
export enum EmojiTypeEnum {
|
||||
small,
|
||||
medium
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue