Class: MdSimpleEditorController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/md_simple_editor_controller.rb

Instance Method Summary collapse

Instance Method Details

#previewObject



2
3
4
5
6
# File 'app/controllers/md_simple_editor_controller.rb', line 2

def preview
  options = {autolink: true, tables: true, hard_wrap: true, no_intra_emphasis: true, fenced_code:true, gh_blockcode: true}
  html = Redcarpet::Markdown.new(Redcarpet::Render::HTML, options).render(params['md']).html_safe
  render text: html
end