Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Rubynaut's Profile

GitHub User: rubynautme

Site: https://rubynaut.me

Comments by Rubynaut

Avatar

as an easy solution try out the gem dejan/auto_html

ruby
include AutoHtml

def markdown(text)
  text = auto_html(text) do
    youtube ( width: 400, height: 250 )
    vimeo ( width: 400, height: 250 )
  end

  extensions = [tables: true, autolink: true, strikethrough: true]
  Redcarpet::Markdown.new(Redcarpet::Render::XHTML, *extensions).render(text).html_safe
end