sforkowany z mirror/soapbox
Big emojis: fix nodeList count
rodzic
2082c19c53
commit
60bdccc0b5
|
@ -2,10 +2,10 @@
|
|||
export const onlyEmoji = (node, limit = 1) => {
|
||||
if (!node) return false;
|
||||
if (node.textContent.replaceAll(' ', '') !== '') return false;
|
||||
const emojis = [...node.querySelectorAll('img.emojione')];
|
||||
const emojis = Array.from(node.querySelectorAll('img.emojione'));
|
||||
if (emojis.length === 0) return false;
|
||||
if (emojis.length > limit) return false;
|
||||
const images = [...node.querySelectorAll('img')];
|
||||
const images = Array.from(node.querySelectorAll('img'));
|
||||
if (images.length > emojis.length) return false;
|
||||
return true;
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue