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
4872b319
Commit
4872b319
authored
Jan 12, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the WikiPipeline when rendering the wiki markdown content
parent
a6a5990e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
3 deletions
+26
-3
app/helpers/gitlab_markdown_helper.rb
app/helpers/gitlab_markdown_helper.rb
+1
-1
lib/banzai/pipeline/gollum_tags_pipeline.rb
lib/banzai/pipeline/gollum_tags_pipeline.rb
+13
-0
lib/banzai/pipeline/wiki_pipeline.rb
lib/banzai/pipeline/wiki_pipeline.rb
+9
-0
spec/helpers/gitlab_markdown_helper_spec.rb
spec/helpers/gitlab_markdown_helper_spec.rb
+3
-2
No files found.
app/helpers/gitlab_markdown_helper.rb
View file @
4872b319
...
@@ -91,7 +91,7 @@ module GitlabMarkdownHelper
...
@@ -91,7 +91,7 @@ module GitlabMarkdownHelper
def
render_wiki_content
(
wiki_page
)
def
render_wiki_content
(
wiki_page
)
case
wiki_page
.
format
case
wiki_page
.
format
when
:markdown
when
:markdown
markdown
(
wiki_page
.
content
)
markdown
(
wiki_page
.
content
,
pipeline: :wiki
,
project_wiki:
@project_wiki
)
when
:asciidoc
when
:asciidoc
asciidoc
(
wiki_page
.
content
)
asciidoc
(
wiki_page
.
content
)
else
else
...
...
lib/banzai/pipeline/gollum_tags_pipeline.rb
0 → 100644
View file @
4872b319
require
'banzai'
module
Banzai
module
Pipeline
class
GollumTagsPipeline
<
BasePipeline
def
self
.
filters
[
Filter
::
GollumTagsFilter
]
end
end
end
end
lib/banzai/pipeline/wiki_pipeline.rb
0 → 100644
View file @
4872b319
require
'banzai'
module
Banzai
module
Pipeline
class
WikiPipeline
<
CombinedPipeline
.
new
(
PlainMarkdownPipeline
,
GollumTagsPipeline
,
GfmPipeline
)
end
end
end
spec/helpers/gitlab_markdown_helper_spec.rb
View file @
4872b319
...
@@ -121,12 +121,13 @@ describe GitlabMarkdownHelper do
...
@@ -121,12 +121,13 @@ describe GitlabMarkdownHelper do
before
do
before
do
@wiki
=
double
(
'WikiPage'
)
@wiki
=
double
(
'WikiPage'
)
allow
(
@wiki
).
to
receive
(
:content
).
and_return
(
'wiki content'
)
allow
(
@wiki
).
to
receive
(
:content
).
and_return
(
'wiki content'
)
helper
.
instance_variable_set
(
:@project_wiki
,
@wiki
)
end
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
)
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
)
helper
.
render_wiki_content
(
@wiki
)
end
end
...
...
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