Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
3f8d487e
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,发现更多精彩内容 >>
提交
3f8d487e
编写于
5月 07, 2015
作者:
S
Sytse Sijbrandij
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
上级
2576971f
9d34efb5
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
23 addition
and
2 deletion
+23
-2
spec/features/markdown_spec.rb
spec/features/markdown_spec.rb
+15
-2
spec/fixtures/markdown.md.erb
spec/fixtures/markdown.md.erb
+8
-0
未找到文件。
spec/features/markdown_spec.rb
浏览文件 @
3f8d487e
...
...
@@ -62,7 +62,7 @@ describe 'GitLab Markdown' do
# Given a header ID, goes to that element's parent (the header), then to its
# second sibling (the body).
def
get_section
(
id
)
@doc
.
at_css
(
"#
#{
id
}
"
).
parent
.
next
.
nex
t
@doc
.
at_css
(
"#
#{
id
}
"
).
parent
.
next
_elemen
t
end
# it 'writes to a file' do
...
...
@@ -161,6 +161,19 @@ describe 'GitLab Markdown' do
end
end
describe
'Edge Cases'
do
it
'allows markup inside link elements'
do
expect
(
@doc
.
at_css
(
'a[href="#link-emphasis"]'
).
to_html
).
to
eq
%{<a href="#link-emphasis"><em>text</em></a>}
expect
(
@doc
.
at_css
(
'a[href="#link-strong"]'
).
to_html
).
to
eq
%{<a href="#link-strong"><strong>text</strong></a>}
expect
(
@doc
.
at_css
(
'a[href="#link-code"]'
).
to_html
).
to
eq
%{<a href="#link-code"><code>text</code></a>}
end
end
describe
'EmojiFilter'
do
it
'parses Emoji'
do
expect
(
@doc
).
to
have_selector
(
'img.emoji'
,
count:
10
)
...
...
@@ -176,7 +189,7 @@ describe 'GitLab Markdown' do
end
describe
'AutolinkFilter'
do
let
(
:list
)
{
get_section
(
'autolinkfilter'
).
parent
.
search
(
'ul'
)
}
let
(
:list
)
{
get_section
(
'autolinkfilter'
).
next_element
}
def
item
(
index
)
list
.
at_css
(
"li:nth-child(
#{
index
}
)"
)
...
...
spec/fixtures/markdown.md.erb
浏览文件 @
3f8d487e
...
...
@@ -94,6 +94,14 @@ The problem with SanitizationFilter is that it can be too aggressive.
| `1
<
3
&
5`
|
1
&
lt
;
3
&
amp
;
5
|
1
<
3
&
5
|
|
`<
foo
>
` |
<
foo
>
|
<foo>
|
### Edge Cases
Markdown should be usable inside a link. Let's try!
- [_text_](#link-emphasis)
- [**text**](#link-strong)
- [`text`](#link-code)
### EmojiFilter
Because life would be :zzz: without Emoji, right? :rocket:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录