Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'redcarpet'
- require 'rails'
- def markdown(text)
- markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
- extensions = {
- autolink: true,
- tables: true,
- no_intraemphasis: true,
- hard_wrap: true,
- filter_html: true
- })
- raw(markdown.render(text))
- end
- text = '_italic_ and **bold** and `@inline_code` and: \n </code snippet>'
- p markdown(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement