mirror of
https://github.com/twitter/twemoji.git
synced 2024-12-27 03:16:23 +00:00
Non standard OS smiley variant
This commit is contained in:
parent
9020ac7e6b
commit
75f9d5234f
@ -479,7 +479,7 @@ wru.test([{
|
||||
div.getElementsByTagName('img')[0].alt.length === 2);
|
||||
}
|
||||
},{
|
||||
name: 'non standard OSX asterisk keycap variant',
|
||||
name: 'non standard iOS asterisk keycap variant',
|
||||
test: function () {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '*\ufe0f\u20e3';
|
||||
@ -508,6 +508,32 @@ wru.test([{
|
||||
wru.assert('the length is preserved',
|
||||
div.getElementsByTagName('img')[0].alt.length === 2);
|
||||
}
|
||||
}, {
|
||||
name: 'non standard iOS smiley variant',
|
||||
test: function () {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '\u2639\ufe0f';
|
||||
twemoji.parse(div);
|
||||
wru.assert('recognized as graphical',
|
||||
div.firstChild.className === 'emoji' &&
|
||||
div.firstChild.getAttribute('draggable') === 'false' &&
|
||||
div.firstChild.getAttribute('alt') === '\u2639\ufe0f' &&
|
||||
div.firstChild.src === 'https://twemoji.maxcdn.com/2/72x72/2639.png'
|
||||
);
|
||||
}
|
||||
},{
|
||||
name: 'same but standard smiley',
|
||||
test: function () {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '\u2639';
|
||||
twemoji.parse(div);
|
||||
wru.assert('recognized as graphical',
|
||||
div.firstChild.className === 'emoji' &&
|
||||
div.firstChild.getAttribute('draggable') === 'false' &&
|
||||
div.firstChild.getAttribute('alt') === '\u2639' &&
|
||||
div.firstChild.src === 'https://twemoji.maxcdn.com/2/72x72/2639.png'
|
||||
);
|
||||
}
|
||||
}, {
|
||||
name: 'multiple parsing using a callback',
|
||||
test: function () {
|
||||
@ -627,6 +653,7 @@ wru.test([{
|
||||
'\ud83d\ude14',
|
||||
'\ud83d\ude15',
|
||||
'\ud83d\ude41',
|
||||
'\u2639\ufe0f',
|
||||
'\ud83d\ude23',
|
||||
'\ud83d\ude16',
|
||||
'\ud83d\ude2b',
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
2/twemoji.min.js
vendored
2
2/twemoji.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -168,6 +168,8 @@ Queue([
|
||||
|
||||
// iOS keyboard allows U+002A U+FE0F U+20E3 even though not a standardized variant (yet?)
|
||||
q.variantsSensitive.push('002A');
|
||||
// iOS keyboard allows U+2639 U+FE0F even though not a standardized variant (yet?)
|
||||
q.variantsSensitive.push('2639');
|
||||
|
||||
console.log('[INFO] parsed ' + q.variantsSensitive.length + ' variant sensitive emoji.');
|
||||
q.next();
|
||||
@ -188,7 +190,6 @@ Queue([
|
||||
assets[path].forEach(function (emoji) {
|
||||
if (
|
||||
q.emojiSource.indexOf(emoji) < 0 &&
|
||||
q.variantsSensitive.indexOf(emoji) < 0 &&
|
||||
q.nonStandard.indexOf(emoji) < 0
|
||||
) {
|
||||
q.nonStandard.push(emoji);
|
||||
|
Loading…
Reference in New Issue
Block a user