Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
57f8b24f
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,发现更多精彩内容 >>
提交
57f8b24f
编写于
2月 01, 2018
作者:
T
Tony Rom
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix minors
上级
d90d141c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
27 deletion
+19
-27
app/assets/stylesheets/framework/gfm.scss
app/assets/stylesheets/framework/gfm.scss
+7
-9
lib/banzai/color_parser.rb
lib/banzai/color_parser.rb
+8
-14
spec/javascripts/gfm_auto_complete_spec.js
spec/javascripts/gfm_auto_complete_spec.js
+4
-4
未找到文件。
app/assets/stylesheets/framework/gfm.scss
浏览文件 @
57f8b24f
...
...
@@ -19,21 +19,19 @@
.gfm-color_chip
{
display
:
inline-block
;
margin-left
:
4px
;
margin-bottom
:
2px
;
margin
:
0
0
2px
4px
;
vertical-align
:
middle
;
border-radius
:
3px
;
$
sid
e
:
0
.9em
;
$bg-size
:
$
sid
e
/
0
.9
;
$
chip-siz
e
:
0
.9em
;
$bg-size
:
$
chip-siz
e
/
0
.9
;
$bg-pos
:
$bg-size
/
2
;
$bg-color
:
$gray-dark
;
width
:
$
sid
e
;
height
:
$
sid
e
;
width
:
$
chip-siz
e
;
height
:
$
chip-siz
e
;
background
:
$white-light
;
background-image
:
linear-gradient
(
135deg
,
$
bg-color
25%
,
transparent
0%
,
transparent
75%
,
$bg-color
0%
)
,
linear-gradient
(
135deg
,
$
bg-color
25%
,
transparent
0%
,
transparent
75%
,
$bg-color
0%
);
background-image
:
linear-gradient
(
135deg
,
$
gray-dark
25%
,
transparent
0%
,
transparent
75%
,
$gray-dark
0%
)
,
linear-gradient
(
135deg
,
$
gray-dark
25%
,
transparent
0%
,
transparent
75%
,
$gray-dark
0%
);
background-size
:
$bg-size
$bg-size
;
background-position
:
0
0
,
$bg-pos
$bg-pos
;
...
...
lib/banzai/color_parser.rb
浏览文件 @
57f8b24f
...
...
@@ -30,21 +30,15 @@ module Banzai
FORMATS
=
[
HEX_FORMAT
,
RGB_FORMAT
,
HSL_FORMAT
].
freeze
class
<<
self
# Public: Analyzes whether the String is a color code.
#
# text - The String to be parsed.
#
# Returns the recognized color String or nil if none was found.
def
parse
(
text
)
text
if
color_format
=~
text
end
COLOR_FORMAT
=
/\A(
#{
Regexp
.
union
(
FORMATS
)
}
)\z/ix
private
def
color_format
@color_format
||=
/\A(
#{
Regexp
.
union
(
FORMATS
)
}
)\z/ix
end
# Public: Analyzes whether the String is a color code.
#
# text - The String to be parsed.
#
# Returns the recognized color String or nil if none was found.
def
self
.
parse
(
text
)
text
if
COLOR_FORMAT
=~
text
end
end
end
spec/javascripts/gfm_auto_complete_spec.js
浏览文件 @
57f8b24f
...
...
@@ -130,11 +130,11 @@ describe('GfmAutoComplete', function () {
});
describe
(
'
should not match special sequences
'
,
()
=>
{
const
S
houldNotBeFollowedBy
=
flags
.
concat
([
'
\
x00
'
,
'
\
x10
'
,
'
\
x3f
'
,
'
\n
'
,
'
'
]);
const
S
houldNotBePrependedBy
=
[
'
`
'
];
const
s
houldNotBeFollowedBy
=
flags
.
concat
([
'
\
x00
'
,
'
\
x10
'
,
'
\
x3f
'
,
'
\n
'
,
'
'
]);
const
s
houldNotBePrependedBy
=
[
'
`
'
];
flagsUseDefaultMatcher
.
forEach
((
atSign
)
=>
{
S
houldNotBeFollowedBy
.
forEach
((
followedSymbol
)
=>
{
s
houldNotBeFollowedBy
.
forEach
((
followedSymbol
)
=>
{
const
seq
=
atSign
+
followedSymbol
;
it
(
`should not match "
${
seq
}
"`
,
()
=>
{
...
...
@@ -142,7 +142,7 @@ describe('GfmAutoComplete', function () {
});
});
S
houldNotBePrependedBy
.
forEach
((
prependedSymbol
)
=>
{
s
houldNotBePrependedBy
.
forEach
((
prependedSymbol
)
=>
{
const
seq
=
prependedSymbol
+
atSign
;
it
(
`should not match "
${
seq
}
"`
,
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录