lib/redcarpet.rb in redcarpet-2.0.0b5 vs lib/redcarpet.rb in redcarpet-2.0.0

- old
+ new

@@ -51,5 +51,23 @@ end end end end +# Compatibility class; +# Creates a instance of Redcarpet with the RedCloth +# API. This instance has no extensions enabled whatsoever, +# and no accessors to change this. 100% pure, standard +# Markdown. +class RedcarpetCompat + attr_accessor :text + + def initialize(text, *_dummy) + @text = text + @markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML) + end + + def to_html(*_dummy) + @markdown.render(@text) + end +end +