Module: ERB::Util
- Defined in:
- lib/redcloth/erb_extension.rb
Class Method Summary collapse
-
.t ⇒ Object
A utility method for transforming Textile in s to HTML.
-
.textilize(s) ⇒ Object
A utility method for transforming Textile in s to HTML.
Class Method Details
.t ⇒ 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’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’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 |