2018-08-03 07:15:25 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-04-13 17:21:07 +00:00
|
|
|
module BlobViewer
|
|
|
|
class Markup < Base
|
|
|
|
include Rich
|
|
|
|
include ServerSide
|
|
|
|
|
|
|
|
self.partial_name = 'markup'
|
|
|
|
self.extensions = Gitlab::MarkupHelper::EXTENSIONS
|
2017-05-18 19:51:19 +00:00
|
|
|
self.file_types = %i(readme)
|
2017-04-24 17:51:56 +00:00
|
|
|
self.binary = false
|
2020-10-07 12:09:12 +00:00
|
|
|
|
|
|
|
def banzai_render_context
|
|
|
|
{}.tap do |h|
|
|
|
|
h[:rendered] = blob.rendered_markup if blob.respond_to?(:rendered_markup)
|
|
|
|
|
2021-07-05 09:07:37 +00:00
|
|
|
h[:cache_key] = ['blob', blob.id, 'commit', blob.commit_id]
|
2020-10-07 12:09:12 +00:00
|
|
|
end
|
|
|
|
end
|
2017-04-13 17:21:07 +00:00
|
|
|
end
|
|
|
|
end
|