Class: Webgen::ContentProcessor::RedCloth

Inherits:
Object
  • Object
show all
Defined in:
lib/webgen/contentprocessor/redcloth.rb

Overview

Processes content in Textile format using the redcloth library.

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object

Convert the content in context to HTML.



9
10
11
12
13
14
15
# File 'lib/webgen/contentprocessor/redcloth.rb', line 9

def call(context)
  require 'redcloth'
  doc = ::RedCloth.new(context.content)
  doc.hard_breaks = context.website.config['contentprocessor.redcloth.hard_breaks']
  context.content = doc.to_html
  context
end