other_markup.rb 517 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4 5 6 7 8 9
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
    #
10
    def self.render(file_name, input, context)
11 12
      html = GitHub::Markup.render(file_name, input)
        .force_encoding(input.encoding)
13
      context[:pipeline] ||= :markup
14

15
      html = Banzai.render(html, context)
16

17 18 19 20
      html.html_safe
    end
  end
end