Emoji Tooltip: Fix for Firefox (#1189)
This commit is contained in:
parent
6751813049
commit
c6d1b8a9c4
@ -168,7 +168,7 @@ export default function useEmojiTooltip(
|
|||||||
function getEmojiCode(html: string) {
|
function getEmojiCode(html: string) {
|
||||||
const tempEl = document.createElement('div');
|
const tempEl = document.createElement('div');
|
||||||
tempEl.innerHTML = html.replace('<br>', '\n');
|
tempEl.innerHTML = html.replace('<br>', '\n');
|
||||||
const text = tempEl.innerText;
|
const text = tempEl.innerText.replace(/\n$/i, '');
|
||||||
|
|
||||||
const lastSymbol = text[text.length - 1];
|
const lastSymbol = text[text.length - 1];
|
||||||
const lastWord = text.split(RE_NOT_EMOJI_SEARCH).pop();
|
const lastWord = text.split(RE_NOT_EMOJI_SEARCH).pop();
|
||||||
|
|||||||
@ -102,7 +102,7 @@ export default function useMentionTooltip(
|
|||||||
function getUsernameFilter(html: string) {
|
function getUsernameFilter(html: string) {
|
||||||
const tempEl = document.createElement('div');
|
const tempEl = document.createElement('div');
|
||||||
tempEl.innerHTML = html;
|
tempEl.innerHTML = html;
|
||||||
const text = tempEl.innerText;
|
const text = tempEl.innerText.replace(/\n$/i, '');
|
||||||
|
|
||||||
const lastSymbol = text[text.length - 1];
|
const lastSymbol = text[text.length - 1];
|
||||||
const lastWord = text.split(RE_NOT_USERNAME_SEARCH).pop();
|
const lastWord = text.split(RE_NOT_USERNAME_SEARCH).pop();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user