Merge pull request #3718 from tgxworld/allow_emojis_to_be_copy_and_pasted
FIX: Allow user to quote Emojis.
This commit is contained in:
@@ -77,7 +77,8 @@ function imageFor(code) {
|
||||
code = code.toLowerCase();
|
||||
var url = urlFor(code);
|
||||
if (url) {
|
||||
return ['img', { href: url, title: ':' + code + ':', 'class': 'emoji', alt: code }];
|
||||
var code = ':' + code + ':';
|
||||
return ['img', { href: url, title: code, 'class': 'emoji', alt: code }];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,10 @@ Discourse.Utilities = {
|
||||
// Strip out any .click elements from the HTML before converting it to text
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = html;
|
||||
$('.clicks', $(div)).remove();
|
||||
var $div = $(div);
|
||||
// Find all emojis and replace with its title attribute.
|
||||
$div.find('img.emoji').replaceWith(function() { return this.title });
|
||||
$('.clicks', $div).remove();
|
||||
var text = div.textContent || div.innerText || "";
|
||||
|
||||
return String(text).trim();
|
||||
|
||||
Reference in New Issue
Block a user