6

I'm writing a Ruby app and it currently uses redcarpet to render Markdown.

I need to strip Markdown markup from a text. Any easy way to do it?

sumek
  • 26,495
  • 13
  • 56
  • 75

1 Answers1

11

Yes, it's possible with the Redcarpet::Render::StripDown Class -> https://rubydoc.info/gems/redcarpet/Redcarpet/Render/StripDown

It says "Turns Markdown into plaintext"

Dave Powers
  • 2,051
  • 2
  • 30
  • 34
Caillou
  • 1,451
  • 10
  • 19
  • Thanks! D'oh! Should have searched better. – sumek Feb 12 '16 at 10:20
  • 2
    I ran into an `Uninitialized constant: Redcarpet::Render::StripDown` error, but adding `require 'redcarpet/render_strip'` fixed it; see https://github.com/vmg/redcarpet/issues/138 – GoBusto Jun 01 '19 at 15:13