2020-01-26 15:09:11 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
class WikiPage < WikiPageBasic
|
2022-03-08 15:15:55 +00:00
|
|
|
include ::MarkupHelper
|
|
|
|
|
|
|
|
expose :content do |wiki_page, options|
|
2022-05-20 15:09:10 +00:00
|
|
|
if options[:render_html]
|
|
|
|
render_wiki_content(
|
|
|
|
wiki_page,
|
|
|
|
ref: wiki_page.version.id,
|
|
|
|
current_user: options[:current_user]
|
|
|
|
)
|
|
|
|
else
|
|
|
|
wiki_page.content
|
|
|
|
end
|
2022-03-08 15:15:55 +00:00
|
|
|
end
|
2022-02-24 18:19:04 +00:00
|
|
|
|
|
|
|
expose :encoding do |wiki_page|
|
|
|
|
wiki_page.content.encoding.name
|
|
|
|
end
|
2020-01-26 15:09:11 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|