Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
3f8d487e
Commit
3f8d487e
authored
May 07, 2015
by
Sytse Sijbrandij
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
2576971f
9d34efb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+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
No files found.
spec/features/markdown_spec.rb
View file @
3f8d487e
...
@@ -62,7 +62,7 @@ describe 'GitLab Markdown' do
...
@@ -62,7 +62,7 @@ describe 'GitLab Markdown' do
# Given a header ID, goes to that element's parent (the header), then to its
# Given a header ID, goes to that element's parent (the header), then to its
# second sibling (the body).
# second sibling (the body).
def
get_section
(
id
)
def
get_section
(
id
)
@doc
.
at_css
(
"#
#{
id
}
"
).
parent
.
next
.
nex
t
@doc
.
at_css
(
"#
#{
id
}
"
).
parent
.
next
_elemen
t
end
end
# it 'writes to a file' do
# it 'writes to a file' do
...
@@ -161,6 +161,19 @@ describe 'GitLab Markdown' do
...
@@ -161,6 +161,19 @@ describe 'GitLab Markdown' do
end
end
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
describe
'EmojiFilter'
do
it
'parses Emoji'
do
it
'parses Emoji'
do
expect
(
@doc
).
to
have_selector
(
'img.emoji'
,
count:
10
)
expect
(
@doc
).
to
have_selector
(
'img.emoji'
,
count:
10
)
...
@@ -176,7 +189,7 @@ describe 'GitLab Markdown' do
...
@@ -176,7 +189,7 @@ describe 'GitLab Markdown' do
end
end
describe
'AutolinkFilter'
do
describe
'AutolinkFilter'
do
let
(
:list
)
{
get_section
(
'autolinkfilter'
).
parent
.
search
(
'ul'
)
}
let
(
:list
)
{
get_section
(
'autolinkfilter'
).
next_element
}
def
item
(
index
)
def
item
(
index
)
list
.
at_css
(
"li:nth-child(
#{
index
}
)"
)
list
.
at_css
(
"li:nth-child(
#{
index
}
)"
)
...
...
spec/fixtures/markdown.md.erb
View file @
3f8d487e
...
@@ -94,6 +94,14 @@ The problem with SanitizationFilter is that it can be too aggressive.
...
@@ -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
|
| `1
<
3
&
5
`
|
1
&
lt
;
3
&
amp
;
5
|
1
<
3
&
5
|
|
`<
foo
>
` |
<
foo
>
|
<foo>
|
|
`<
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
### EmojiFilter
Because life would be :zzz: without Emoji, right? :rocket:
Because life would be :zzz: without Emoji, right? :rocket:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment