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
Tatuya Kamada
gitlab-ce
Commits
b4828f4c
Commit
b4828f4c
authored
Oct 09, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable markdown pipeline filters from inside gitlab.
parent
2fb99c79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
lib/gitlab/markdown.rb
lib/gitlab/markdown.rb
+11
-8
No files found.
lib/gitlab/markdown.rb
View file @
b4828f4c
...
...
@@ -70,14 +70,17 @@ module Gitlab
insert_piece
(
$1
)
end
# Context passed to the markdoqwn pipeline
markdown_context
=
{
asset_root:
File
.
join
(
root_url
,
Gitlab
::
Application
.
config
.
assets
.
prefix
)
}
result
=
HTML
::
Pipeline
::
Gitlab
::
MarkdownPipeline
.
call
(
text
,
markdown_context
)
# Used markdown pipelines in GitLab:
# GitlabEmojiFilter - performs emoji replacement.
#
# see https://gitlab.com/gitlab-org/html-pipeline-gitlab for more filters
filters
=
[
HTML
::
Pipeline
::
Gitlab
::
GitlabEmojiFilter
]
markdown_pipeline
=
HTML
::
Pipeline
::
Gitlab
.
new
(
filters
).
pipeline
result
=
markdown_pipeline
.
call
(
text
)
text
=
result
[
:output
].
to_html
(
save_with:
0
)
allowed_attributes
=
ActionView
::
Base
.
sanitized_allowed_attributes
...
...
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