2018-10-22 03:00:50 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-02-01 11:07:59 -05:00
|
|
|
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
|
|
|
|
#
|
2017-05-02 10:52:19 -04:00
|
|
|
def self.render(file_name, input, context)
|
2017-06-21 09:48:12 -04:00
|
|
|
html = GitHub::Markup.render(file_name, input)
|
|
|
|
.force_encoding(input.encoding)
|
2019-10-03 00:01:57 -04:00
|
|
|
context[:pipeline] ||= :markup
|
2016-02-01 11:07:59 -05:00
|
|
|
|
2017-05-02 10:52:19 -04:00
|
|
|
html = Banzai.render(html, context)
|
2017-02-09 12:30:06 -05:00
|
|
|
|
2016-02-01 11:07:59 -05:00
|
|
|
html.html_safe
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|