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
Léo-Paul Géneau
gitlab-ce
Commits
8e7111f7
Commit
8e7111f7
authored
Aug 27, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reference filters no longer take a custom class context option
parent
a4e4fde3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1 addition
and
43 deletions
+1
-43
lib/gitlab/markdown.rb
lib/gitlab/markdown.rb
+0
-1
lib/gitlab/markdown/reference_filter.rb
lib/gitlab/markdown/reference_filter.rb
+1
-2
spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
...lib/gitlab/markdown/commit_range_reference_filter_spec.rb
+0
-5
spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
+0
-5
spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
...b/gitlab/markdown/external_issue_reference_filter_spec.rb
+0
-5
spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
+0
-5
spec/lib/gitlab/markdown/label_reference_filter_spec.rb
spec/lib/gitlab/markdown/label_reference_filter_spec.rb
+0
-5
spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
...ib/gitlab/markdown/merge_request_reference_filter_spec.rb
+0
-5
spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
+0
-5
spec/lib/gitlab/markdown/user_reference_filter_spec.rb
spec/lib/gitlab/markdown/user_reference_filter_spec.rb
+0
-5
No files found.
lib/gitlab/markdown.rb
View file @
8e7111f7
...
@@ -67,7 +67,6 @@ module Gitlab
...
@@ -67,7 +67,6 @@ module Gitlab
# options - A Hash of options used to customize output (default: {}):
# options - A Hash of options used to customize output (default: {}):
# :xhtml - output XHTML instead of HTML
# :xhtml - output XHTML instead of HTML
# :reference_only_path - Use relative path for reference links
# :reference_only_path - Use relative path for reference links
# html_options - extra options for the reference links as given to link_to
def
self
.
gfm
(
text
,
options
=
{})
def
self
.
gfm
(
text
,
options
=
{})
return
text
if
text
.
nil?
return
text
if
text
.
nil?
...
...
lib/gitlab/markdown/reference_filter.rb
View file @
8e7111f7
...
@@ -9,7 +9,6 @@ module Gitlab
...
@@ -9,7 +9,6 @@ module Gitlab
#
#
# Context options:
# Context options:
# :project (required) - Current project, ignored if reference is cross-project.
# :project (required) - Current project, ignored if reference is cross-project.
# :reference_class - Custom CSS class added to reference links.
# :only_path - Generate path-only links.
# :only_path - Generate path-only links.
#
#
# Results:
# Results:
...
@@ -70,7 +69,7 @@ module Gitlab
...
@@ -70,7 +69,7 @@ module Gitlab
end
end
def
reference_class
(
type
)
def
reference_class
(
type
)
"gfm gfm-
#{
type
}
#{
context
[
:reference_class
]
}
"
.
strip
"gfm gfm-
#{
type
}
"
.
strip
end
end
# Iterate through the document's text nodes, yielding the current node's
# Iterate through the document's text nodes, yielding the current node's
...
...
spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
View file @
8e7111f7
...
@@ -75,11 +75,6 @@ module Gitlab::Markdown
...
@@ -75,11 +75,6 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-commit_range'
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-commit_range'
end
end
it
'includes an optional custom class'
do
doc
=
filter
(
"See
#{
reference
}
"
,
reference_class:
'custom'
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"See
#{
reference
}
"
)
doc
=
filter
(
"See
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
link
=
doc
.
css
(
'a'
).
first
...
...
spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
View file @
8e7111f7
...
@@ -71,11 +71,6 @@ module Gitlab::Markdown
...
@@ -71,11 +71,6 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-commit'
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-commit'
end
end
it
'includes an optional custom class'
do
doc
=
filter
(
"See
#{
reference
}
"
,
reference_class:
'custom'
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"See
#{
reference
}
"
)
doc
=
filter
(
"See
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
link
=
doc
.
css
(
'a'
).
first
...
...
spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
View file @
8e7111f7
...
@@ -68,11 +68,6 @@ module Gitlab::Markdown
...
@@ -68,11 +68,6 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-issue'
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-issue'
end
end
it
'includes an optional custom class'
do
doc
=
filter
(
"Issue
#{
reference
}
"
,
reference_class:
'custom'
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'supports an :only_path context'
do
it
'supports an :only_path context'
do
doc
=
filter
(
"Issue
#{
reference
}
"
,
only_path:
true
)
doc
=
filter
(
"Issue
#{
reference
}
"
,
only_path:
true
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
...
...
spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
View file @
8e7111f7
...
@@ -68,11 +68,6 @@ module Gitlab::Markdown
...
@@ -68,11 +68,6 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-issue'
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-issue'
end
end
it
'includes an optional custom class'
do
doc
=
filter
(
"Issue
#{
reference
}
"
,
reference_class:
'custom'
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"Issue
#{
reference
}
"
)
doc
=
filter
(
"Issue
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
link
=
doc
.
css
(
'a'
).
first
...
...
spec/lib/gitlab/markdown/label_reference_filter_spec.rb
View file @
8e7111f7
...
@@ -25,11 +25,6 @@ module Gitlab::Markdown
...
@@ -25,11 +25,6 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-label'
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-label'
end
end
it
'includes an optional custom class'
do
doc
=
filter
(
"Label
#{
reference
}
"
,
reference_class:
'custom'
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"Label
#{
reference
}
"
)
doc
=
filter
(
"Label
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
link
=
doc
.
css
(
'a'
).
first
...
...
spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
View file @
8e7111f7
...
@@ -56,11 +56,6 @@ module Gitlab::Markdown
...
@@ -56,11 +56,6 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-merge_request'
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-merge_request'
end
end
it
'includes an optional custom class'
do
doc
=
filter
(
"Merge
#{
reference
}
"
,
reference_class:
'custom'
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"Merge
#{
reference
}
"
)
doc
=
filter
(
"Merge
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
link
=
doc
.
css
(
'a'
).
first
...
...
spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
View file @
8e7111f7
...
@@ -55,11 +55,6 @@ module Gitlab::Markdown
...
@@ -55,11 +55,6 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-snippet'
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-snippet'
end
end
it
'includes an optional custom class'
do
doc
=
filter
(
"Snippet
#{
reference
}
"
,
reference_class:
'custom'
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"Snippet
#{
reference
}
"
)
doc
=
filter
(
"Snippet
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
link
=
doc
.
css
(
'a'
).
first
...
...
spec/lib/gitlab/markdown/user_reference_filter_spec.rb
View file @
8e7111f7
...
@@ -130,11 +130,6 @@ module Gitlab::Markdown
...
@@ -130,11 +130,6 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-project_member'
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
eq
'gfm gfm-project_member'
end
end
it
'includes an optional custom class'
do
doc
=
filter
(
"Hey
#{
reference
}
"
,
reference_class:
'custom'
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'supports an :only_path context'
do
it
'supports an :only_path context'
do
doc
=
filter
(
"Hey
#{
reference
}
"
,
only_path:
true
)
doc
=
filter
(
"Hey
#{
reference
}
"
,
only_path:
true
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
...
...
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