engines/adva_cms/vendor/plugins/stringex/lib/lucky_sneaks/string_extensions.rb
# Returns the string converted (via Textile/RedCloth) to HTML format or
# self if Redcloth is not available.
# 
# Using <tt>:lite</tt> argument will cause RedCloth to not wrap the HTML in a container
# P element, which is useful behavior for generating header element text, etc.
# This is roughly equivalent to ActionView's <tt>textilize_without_paragraph</tt>
# except that it makes RedCloth do all the work instead of just gsubbing the return
# from RedCloth.
Returns the string converted (via Textile/RedCloth) to HTML format or
self if Redcloth is not available.

Using :lite argument will cause RedCloth to not wrap the HTML in a container
P element, which is useful behavior for generating header element text, etc.
This is roughly equivalent to ActionView's textilize_without_paragraph
except that it makes RedCloth do all the work instead of just gsubbing the return
from RedCloth.
Returns the string converted ( via Textile / RedCloth ) to HTML format or self if Redcloth is not available . Using : lite argument will cause RedCloth to not wrap the HTML in a container P element which is useful behavior for generating header element text etc . This is roughly equivalent to ActionView ' s textilize_without_paragraph except that it makes RedCloth do all the work instead of just gsubbing the return from RedCloth .
def to_html(lite_mode = false)
      if defined?(RedCloth)
        if lite_mode
          RedCloth.new(self, [:lite_mode]).to_html
        else
          if self =~ /<pre>/
            RedCloth.new(self).to_html.tr("\t", "")
          else
            RedCloth.new(self).to_html.tr("\t", "").gsub(/\n\n/, "")
          end
        end
      else
        self
      end
    end
def to_html ( lite_mode = false ) if defined? ( RedCloth ) if lite_mode RedCloth . new ( self , [ :lite_mode ] ) . to_html else if self =~ / <pre> / RedCloth . new ( self ) . to_html . tr ( "\t" , "" ) else RedCloth . new ( self ) . to_html . tr ( "\t" , "" ) . gsub ( / \n \n / , "" ) end end else self end end
Returns the string converted (via Textile/RedCloth) to HTML format or
self if Redcloth is not available.
Returns the string converted ( via Textile / RedCloth ) to HTML format or self if Redcloth is not available .
lite_mode