mirror of
https://github.com/twitter/twemoji.git
synced 2025-03-28 19:20:28 +00:00
Alternate way to avoid using \u 200d
This commit is contained in:
parent
7d3de547c0
commit
ba0f4e7847
@ -316,7 +316,8 @@ define(function () {
|
||||
*/
|
||||
function grabTheRightIcon(rawText) {
|
||||
// if variant is present as \uFE0F
|
||||
return toCodePoint(rawText.indexOf('\u200D') < 0 ?
|
||||
// (avoid using a string literal for '\u200D' or minifiers may inject the raw value)
|
||||
return toCodePoint(rawText.indexOf(String.fromCharCode(0x200D)) < 0 ?
|
||||
rawText.replace(UFE0Fg, '') :
|
||||
rawText
|
||||
);
|
||||
|
@ -315,7 +315,8 @@ var twemoji = (function (
|
||||
*/
|
||||
function grabTheRightIcon(rawText) {
|
||||
// if variant is present as \uFE0F
|
||||
return toCodePoint(rawText.indexOf('\u200D') < 0 ?
|
||||
// (avoid using a string literal for '\u200D' or minifiers may inject the raw value)
|
||||
return toCodePoint(rawText.indexOf(String.fromCharCode(0x200D)) < 0 ?
|
||||
rawText.replace(UFE0Fg, '') :
|
||||
rawText
|
||||
);
|
||||
|
2
2/twemoji.min.js
vendored
2
2/twemoji.min.js
vendored
File diff suppressed because one or more lines are too long
@ -316,7 +316,8 @@ var twemoji = (function (
|
||||
*/
|
||||
function grabTheRightIcon(rawText) {
|
||||
// if variant is present as \uFE0F
|
||||
return toCodePoint(rawText.indexOf('\u200D') < 0 ?
|
||||
// (avoid using a string literal for '\u200D' or minifiers may inject the raw value)
|
||||
return toCodePoint(rawText.indexOf(String.fromCharCode(0x200D)) < 0 ?
|
||||
rawText.replace(UFE0Fg, '') :
|
||||
rawText
|
||||
);
|
||||
|
@ -45,7 +45,7 @@ require('child_process').spawn(
|
||||
fs.writeFileSync(
|
||||
file('twemoji.min.js'),
|
||||
'/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\n' +
|
||||
fs.readFileSync(file('twemoji.tmp.js')).toString().replace(/("|')\u200D\1/g, '$1\\u200D$1')
|
||||
fs.readFileSync(file('twemoji.tmp.js'))
|
||||
);
|
||||
fs.unlink(file('twemoji.tmp.js'));
|
||||
// gzip -c twemoji.min.js | wc -c
|
||||
|
@ -731,7 +731,8 @@ function createTwemoji(re) {
|
||||
*/
|
||||
function grabTheRightIcon(rawText) {
|
||||
// if variant is present as \uFE0F
|
||||
return toCodePoint(rawText.indexOf('\u200D') < 0 ?
|
||||
// (avoid using a string literal for '\u200D' or minifiers may inject the raw value)
|
||||
return toCodePoint(rawText.indexOf(String.fromCharCode(0x200D)) < 0 ?
|
||||
rawText.replace(UFE0Fg, '') :
|
||||
rawText
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user