Commit b4828f4c authored by Marin Jankovski's avatar Marin Jankovski

Enable markdown pipeline filters from inside gitlab.

parent 2fb99c79
......@@ -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
......
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