Fix emoji not parsing correctly

This commit is contained in:
Jeremy "EndenDragon" Zhang 2020-12-08 11:46:20 -08:00 committed by GitHub
parent 0af45c5dca
commit 38ab257d6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1688,7 +1688,11 @@ var passedCookieTest = true; // If passed cross origin test
disreact.img_url += ".png";
}
} else {
disreact.img_url = $(twemoji.parse(emoji.name)).attr("src");
try {
disreact.img_url = $("<div>" + twemoji.parse(emoji.name) + "</div>").children("img").attr("src");
} catch (err) {
disreact.img_url = $(twemoji.parse(emoji.name)).attr("src");
}
}
var rendered = Mustache.render(template, disreact);
reacts.push(rendered);