Commit 207b7218 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Ensure correct filter order to validate with our markdown spec

parent 22055e10
......@@ -118,7 +118,7 @@ module Banzai
end
if path
content_tag(:img, nil, src: path)
content_tag(:img, nil, src: path, class: tag_class('image'))
end
end
......@@ -155,7 +155,7 @@ module Banzai
href = ::File.join(project_wiki_base_path, reference)
end
content_tag(:a, name || reference, href: href)
content_tag(:a, name || reference, href: href, class: tag_class('page'))
end
def project_wiki
......@@ -172,6 +172,10 @@ module Banzai
def validate
needs :project_wiki
end
def tag_class(type)
"gfm gollum gollum-#{type}"
end
end
end
end
......@@ -4,7 +4,7 @@ module Banzai
def self.filters
@filters ||= begin
super.insert_after(Filter::TableOfContentsFilter, Filter::GollumTagsFilter)
.insert_after(Filter::TableOfContentsFilter, Filter::WikiLinkFilter)
.insert_before(Filter::TaskListFilter, Filter::WikiLinkFilter)
end
end
end
......
......@@ -39,7 +39,7 @@ describe 'GitLab Markdown', feature: true do
end
def doc(html = @html)
Nokogiri::HTML::DocumentFragment.parse(html)
@doc ||= Nokogiri::HTML::DocumentFragment.parse(html)
end
# Shared behavior that all pipelines should exhibit
......
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