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:
parent
1011e6b114
commit
39a091da4b
@ -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",
|
||||
|
@ -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.",
|
||||
|
@ -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
12
test.js
@ -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);
|
||||
}
|
||||
|
@ -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
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
Loading…
Reference in New Issue
Block a user