include AutoHtmldefmarkdown(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
as an easy solution try out the gem dejan/auto_html