BigW Consortium Gitlab

Commit 8e7111f7 by Robert Speicher

Reference filters no longer take a custom class context option

parent a4e4fde3
...@@ -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?
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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')
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment