1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-07-01 02:19:09 +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",
"description": "A Unicode standard based way to implement emoji across all platforms.",
"version": "v1.2.0",
"version": "v1.2.1",
"main": "./twemoji.amd.js",
"ignore": [
".git",

View File

@ -1,5 +1,5 @@
{
"version": "1.1.1",
"version": "1.2.1",
"name": "twemoji",
"license": ["MIT", "CC-BY-4.0"],
"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",
"license": ["MIT", "CC-BY-4.0"],
"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';
twemoji.parse(div);
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',
div.getElementsByTagName('img')[0].alt.length === 3);
}
@ -357,7 +361,11 @@ wru.test([{
div.innerHTML = '5\u20e3';
twemoji.parse(div);
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',
div.getElementsByTagName('img')[0].alt.length === 2);
}

View File

@ -505,7 +505,7 @@ function createTwemoji(re) {
re = /twemoji/,
// 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
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