Module: ERB::Util

Defined in:
lib/redcloth/erb_extension.rb

Class Method Summary collapse

Class Method Details

.tObject

A utility method for transforming Textile in s to HTML.

require “erb” include ERB::Util puts textilize(“Isn't ERB great?”)

Generates

<p>Isn&#8217;t <span class=“caps”>ERB</span> <strong>great</strong>?</p>


22
23
24
25
26
# File 'lib/redcloth/erb_extension.rb', line 22

def textilize( s )
  if s && s.respond_to?(:to_s)
    RedCloth.new( s.to_s ).to_html
  end
end

.textilize(s) ⇒ Object

A utility method for transforming Textile in s to HTML.

require “erb” include ERB::Util puts textilize(“Isn't ERB great?”)

Generates

<p>Isn&#8217;t <span class=“caps”>ERB</span> <strong>great</strong>?</p>


16
17
18
19
20
# File 'lib/redcloth/erb_extension.rb', line 16

def textilize( s )
  if s && s.respond_to?(:to_s)
    RedCloth.new( s.to_s ).to_html
  end
end