gitlab-org--gitlab-foss/lib/gitlab/other_markup.rb
Robert Speicher 99996b6bc7 Merge branch 'bvl-security-9-1-markup-pipeline'
(security-9-1) Render asciidoc & other markup using banzai in a pipeline

See merge request !2098
2017-05-10 16:44:20 +02:00

18 lines
484 B
Ruby

module Gitlab
# Parser/renderer for markups without other special support code.
module OtherMarkup
# Public: Converts the provided markup into HTML.
#
# input - the source text in a markup format
#
def self.render(file_name, input, context)
html = GitHub::Markup.render(file_name, input).
force_encoding(input.encoding)
context[:pipeline] = :markup
html = Banzai.render(html, context)
html.html_safe
end
end
end