Skip to content

Commit

Permalink
Merge pull request #12937 from 0xmiroslav/issue-9505
Browse files Browse the repository at this point in the history
support copy & paste emojis into composer
  • Loading branch information
pecanoro committed Nov 29, 2022
2 parents 8e3cac5 + 8a5b405 commit 1397052
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Composer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ class Composer extends React.Component {

// If HTML has img tag, then fetch images from it.
if (embeddedImages.length > 0 && embeddedImages[0].src) {
// If HTML has emoji, then treat this as plain text.
if (embeddedImages[0].dataset && embeddedImages[0].dataset.stringifyType === 'emoji') {
const plainText = event.clipboardData.getData('text/plain');
this.paste(Str.htmlDecode(plainText));
return;
}
fetch(embeddedImages[0].src)
.then((response) => {
if (!response.ok) { throw Error(response.statusText); }
Expand Down

0 comments on commit 1397052

Please sign in to comment.