Skip to content
Snippets Groups Projects
Commit d4e98659 authored by Toon Claes's avatar Toon Claes
Browse files

WIP attempt to build an org previewer

parent fdaa306e
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
module PreviewOrgmode
extend ActiveSupport::Concern
def preview_orgmode
context = {
current_user: (current_user if defined?(current_user)),
# RelativeLinkFilter
project: project,
commit: @commit,
project_wiki: @project_wiki,
ref: @ref,
requested_path: @path
}
html = Gitlab::OtherMarkup.render('preview.org', params[:text], context)
html = Banzai.post_process(html, context)
html = Hamlit::RailsHelpers.preserve(html)
render json: {
body: html
}
end
end
Loading
Loading
@@ -2,6 +2,7 @@
 
class Projects::WikisController < Projects::ApplicationController
include PreviewMarkdown
include PreviewOrgmode
include Gitlab::Utils::StrongMemoize
 
before_action :authorize_read_wiki!
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment