Skip to content
Snippets Groups Projects
Commit 4872b319 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Use the WikiPipeline when rendering the wiki markdown content

parent a6a5990e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -91,7 +91,7 @@ module GitlabMarkdownHelper
def render_wiki_content(wiki_page)
case wiki_page.format
when :markdown
markdown(wiki_page.content)
markdown(wiki_page.content, pipeline: :wiki, project_wiki: @project_wiki)
when :asciidoc
asciidoc(wiki_page.content)
else
Loading
Loading
require 'banzai'
module Banzai
module Pipeline
class GollumTagsPipeline < BasePipeline
def self.filters
[
Filter::GollumTagsFilter
]
end
end
end
end
require 'banzai'
module Banzai
module Pipeline
class WikiPipeline < CombinedPipeline.new(PlainMarkdownPipeline, GollumTagsPipeline, GfmPipeline)
end
end
end
Loading
Loading
@@ -121,12 +121,13 @@ describe GitlabMarkdownHelper do
before do
@wiki = double('WikiPage')
allow(@wiki).to receive(:content).and_return('wiki content')
helper.instance_variable_set(:@project_wiki, @wiki)
end
 
it "should use GitLab Flavored Markdown for markdown files" do
it "should use Wiki pipeline for markdown files" do
allow(@wiki).to receive(:format).and_return(:markdown)
 
expect(helper).to receive(:markdown).with('wiki content')
expect(helper).to receive(:markdown).with('wiki content', pipeline: :wiki, project_wiki: @wiki)
 
helper.render_wiki_content(@wiki)
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment