debian-mirror-gitlab/lib/gitlab/other_markup.rb

21 lines
515 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2016-04-02 18:10:28 +05:30
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)
2017-09-10 17:25:29 +05:30
html = GitHub::Markup.render(file_name, input)
.force_encoding(input.encoding)
2017-08-17 22:00:37 +05:30
context[:pipeline] = :markup
2016-04-02 18:10:28 +05:30
2017-08-17 22:00:37 +05:30
html = Banzai.render(html, context)
2016-04-02 18:10:28 +05:30
html.html_safe
end
end
end