app/helpers/application_helper.rb
def markdown(text)
    options = {
      filter_html: true,
      hard_wrap: true,
      link_attributes: {rel: 'nofollow', target: "_blank"}
    }
    
    extensions = {
      autolink: true,
      superscript: true,
      no_intra_emphasis: true,
      footnotes: true,
      tables: true
    }
    
    @@renderer ||= Redcarpet::Render::HTML.new(options)
    @@markdown ||= Redcarpet::Markdown.new(@@renderer, extensions)
    
    @@markdown.render(text).html_safe
  end
# Returns the given text as html made with markdown.
Returns the given text as html made with markdown.
Returns the given text as html made with markdown .
def markdown(text)
    options = {
      filter_html: true,
      hard_wrap: true,
      link_attributes: {rel: 'nofollow', target: "_blank"}
    }
    extensions = {
      autolink: true,
      superscript: true,
      no_intra_emphasis: true,
      footnotes: true,
      tables: true
    }
    @@renderer ||= Redcarpet::Render::HTML.new(options)
    @@markdown ||= Redcarpet::Markdown.new(@@renderer, extensions)
    @@markdown.render(text).html_safe
  end
def markdown ( text ) options = { filter_html : true , hard_wrap : true , link_attributes : { rel : 'nofollow' , target : "_blank" } } extensions = { autolink : true , superscript : true , no_intra_emphasis : true , footnotes : true , tables : true } @@renderer ||= Redcarpet :: Render :: HTML . new ( options ) @@markdown ||= Redcarpet :: Markdown . new ( @@renderer , extensions ) @@markdown . render ( text ) . html_safe end
Returns the given text as html made with markdown.
Returns the given text as html made with markdown .
text