1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-06-15 03:35:16 +00:00

added TEXTAREA to the ignore list + fixed test for Firefox too

This commit is contained in:
Andrea Giammarchi 2015-02-16 11:33:43 +00:00
parent 1011e6b114
commit 39a091da4b
9 changed files with 30 additions and 13 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "twemoji", "name": "twemoji",
"description": "A Unicode standard based way to implement emoji across all platforms.", "description": "A Unicode standard based way to implement emoji across all platforms.",
"version": "v1.2.0", "version": "v1.2.1",
"main": "./twemoji.amd.js", "main": "./twemoji.amd.js",
"ignore": [ "ignore": [
".git", ".git",

View File

@ -1,5 +1,5 @@
{ {
"version": "1.1.1", "version": "1.2.1",
"name": "twemoji", "name": "twemoji",
"license": ["MIT", "CC-BY-4.0"], "license": ["MIT", "CC-BY-4.0"],
"description": "A Unicode standard based way to implement emoji across all platforms.", "description": "A Unicode standard based way to implement emoji across all platforms.",

View File

@ -1,5 +1,5 @@
{ {
"version": "1.2.0", "version": "1.2.1",
"name": "twemoji", "name": "twemoji",
"license": ["MIT", "CC-BY-4.0"], "license": ["MIT", "CC-BY-4.0"],
"description": "A Unicode standard based way to implement emoji across all platforms.", "description": "A Unicode standard based way to implement emoji across all platforms.",

12
test.js
View File

@ -346,7 +346,11 @@ wru.test([{
div.innerHTML = '5\ufe0f\u20e3'; div.innerHTML = '5\ufe0f\u20e3';
twemoji.parse(div); twemoji.parse(div);
wru.assert('recognized as graphical', wru.assert('recognized as graphical',
div.innerHTML === '<img class="emoji" draggable="false" alt="5⃣" src="http://twemoji.maxcdn.com/36x36/35-20e3.png">'); div.firstChild.className === 'emoji' &&
div.firstChild.getAttribute('draggable') === 'false' &&
div.firstChild.getAttribute('alt') === "5⃣" &&
div.firstChild.src === 'http://twemoji.maxcdn.com/36x36/35-20e3.png'
);
wru.assert('the length is preserved', wru.assert('the length is preserved',
div.getElementsByTagName('img')[0].alt.length === 3); div.getElementsByTagName('img')[0].alt.length === 3);
} }
@ -357,7 +361,11 @@ wru.test([{
div.innerHTML = '5\u20e3'; div.innerHTML = '5\u20e3';
twemoji.parse(div); twemoji.parse(div);
wru.assert('recognized as graphical', wru.assert('recognized as graphical',
div.innerHTML === '<img class="emoji" draggable="false" alt="5⃣" src="http://twemoji.maxcdn.com/36x36/35-20e3.png">'); div.firstChild.className === 'emoji' &&
div.firstChild.getAttribute('draggable') === 'false' &&
div.firstChild.getAttribute('alt') === "5⃣" &&
div.firstChild.src === 'http://twemoji.maxcdn.com/36x36/35-20e3.png'
);
wru.assert('the length is preserved', wru.assert('the length is preserved',
div.getElementsByTagName('img')[0].alt.length === 2); div.getElementsByTagName('img')[0].alt.length === 2);
} }

View File

@ -505,7 +505,7 @@ function createTwemoji(re) {
re = /twemoji/, re = /twemoji/,
// nodes with type 1 which should **not** be parsed // nodes with type 1 which should **not** be parsed
shouldntBeParsed = /IFRAME|NOFRAMES|NOSCRIPT|SCRIPT|STYLE/, shouldntBeParsed = /IFRAME|NOFRAMES|NOSCRIPT|SCRIPT|STYLE|TEXTAREA/,
// just a private shortcut // just a private shortcut
fromCharCode = String.fromCharCode; fromCharCode = String.fromCharCode;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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