Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c88d9cf3
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c88d9cf3
编写于
6月 02, 2017
作者:
E
Eric Eastwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix NPE with horse racing emoji check
Fix
https://gitlab.com/gitlab-org/gitlab-ce/issues/32587
上级
256a8601
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
1 deletion
+34
-1
app/assets/javascripts/behaviors/gl_emoji.js
app/assets/javascripts/behaviors/gl_emoji.js
+1
-0
app/assets/javascripts/behaviors/gl_emoji/is_emoji_unicode_supported.js
...ascripts/behaviors/gl_emoji/is_emoji_unicode_supported.js
+2
-1
spec/javascripts/gl_emoji_spec.js
spec/javascripts/gl_emoji_spec.js
+31
-0
未找到文件。
app/assets/javascripts/behaviors/gl_emoji.js
浏览文件 @
c88d9cf3
...
...
@@ -88,6 +88,7 @@ function installGlEmojiElement() {
const
hasCssSpriteFalback
=
fallbackSpriteClass
&&
fallbackSpriteClass
.
length
>
0
;
if
(
emojiUnicode
&&
isEmojiUnicode
&&
!
isEmojiUnicodeSupported
(
generatedUnicodeSupportMap
,
emojiUnicode
,
unicodeVersion
)
)
{
...
...
app/assets/javascripts/behaviors/gl_emoji/is_emoji_unicode_supported.js
浏览文件 @
c88d9cf3
...
...
@@ -28,7 +28,8 @@ function isSkinToneComboEmoji(emojiUnicode) {
// doesn't support the skin tone versions of horse racing
const
horseRacingCodePoint
=
127943
;
// parseInt('1F3C7', 16)
function
isHorceRacingSkinToneComboEmoji
(
emojiUnicode
)
{
return
Array
.
from
(
emojiUnicode
)[
0
].
codePointAt
(
0
)
===
horseRacingCodePoint
&&
const
firstCharacter
=
Array
.
from
(
emojiUnicode
)[
0
];
return
firstCharacter
&&
firstCharacter
.
codePointAt
(
0
)
===
horseRacingCodePoint
&&
isSkinToneComboEmoji
(
emojiUnicode
);
}
...
...
spec/javascripts/gl_emoji_spec.js
浏览文件 @
c88d9cf3
...
...
@@ -192,6 +192,9 @@ describe('gl_emoji', () => {
});
describe
(
'
isFlagEmoji
'
,
()
=>
{
it
(
'
should gracefully handle empty string
'
,
()
=>
{
expect
(
isFlagEmoji
(
''
)).
toBeFalsy
();
});
it
(
'
should detect flag_ac
'
,
()
=>
{
expect
(
isFlagEmoji
(
'
🇦🇨
'
)).
toBeTruthy
();
});
...
...
@@ -216,6 +219,9 @@ describe('gl_emoji', () => {
});
describe
(
'
isKeycapEmoji
'
,
()
=>
{
it
(
'
should gracefully handle empty string
'
,
()
=>
{
expect
(
isKeycapEmoji
(
''
)).
toBeFalsy
();
});
it
(
'
should detect one(keycap)
'
,
()
=>
{
expect
(
isKeycapEmoji
(
'
1️⃣
'
)).
toBeTruthy
();
});
...
...
@@ -231,6 +237,9 @@ describe('gl_emoji', () => {
});
describe
(
'
isSkinToneComboEmoji
'
,
()
=>
{
it
(
'
should gracefully handle empty string
'
,
()
=>
{
expect
(
isSkinToneComboEmoji
(
''
)).
toBeFalsy
();
});
it
(
'
should detect hand_splayed_tone5
'
,
()
=>
{
expect
(
isSkinToneComboEmoji
(
'
🖐🏿
'
)).
toBeTruthy
();
});
...
...
@@ -255,6 +264,9 @@ describe('gl_emoji', () => {
});
describe
(
'
isHorceRacingSkinToneComboEmoji
'
,
()
=>
{
it
(
'
should gracefully handle empty string
'
,
()
=>
{
expect
(
isHorceRacingSkinToneComboEmoji
(
''
)).
toBeFalsy
();
});
it
(
'
should detect horse_racing_tone2
'
,
()
=>
{
expect
(
isHorceRacingSkinToneComboEmoji
(
'
🏇🏼
'
)).
toBeTruthy
();
});
...
...
@@ -264,6 +276,9 @@ describe('gl_emoji', () => {
});
describe
(
'
isPersonZwjEmoji
'
,
()
=>
{
it
(
'
should gracefully handle empty string
'
,
()
=>
{
expect
(
isPersonZwjEmoji
(
''
)).
toBeFalsy
();
});
it
(
'
should detect couple_mm
'
,
()
=>
{
expect
(
isPersonZwjEmoji
(
'
👨❤️👨
'
)).
toBeTruthy
();
});
...
...
@@ -300,6 +315,22 @@ describe('gl_emoji', () => {
});
describe
(
'
isEmojiUnicodeSupported
'
,
()
=>
{
it
(
'
should gracefully handle empty string with unicode support
'
,
()
=>
{
const
isSupported
=
isEmojiUnicodeSupported
(
{
'
1.0
'
:
true
},
''
,
'
1.0
'
,
);
expect
(
isSupported
).
toBeTruthy
();
});
it
(
'
should gracefully handle empty string without unicode support
'
,
()
=>
{
const
isSupported
=
isEmojiUnicodeSupported
(
{},
''
,
'
1.0
'
,
);
expect
(
isSupported
).
toBeFalsy
();
});
it
(
'
bomb(6.0) with 6.0 support
'
,
()
=>
{
const
emojiKey
=
'
bomb
'
;
const
unicodeSupportMap
=
Object
.
assign
({},
emptySupportMap
,
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录