mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 11:48:08 +08:00
FIX: Allow user to quote Emojis.
This commit is contained in:
@ -97,7 +97,10 @@ Discourse.Utilities = {
|
|||||||
// Strip out any .click elements from the HTML before converting it to text
|
// Strip out any .click elements from the HTML before converting it to text
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.innerHTML = html;
|
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 || "";
|
var text = div.textContent || div.innerText || "";
|
||||||
|
|
||||||
return String(text).trim();
|
return String(text).trim();
|
||||||
|
Reference in New Issue
Block a user