Files | Admin

Notes:

Release Name: 2.0.5

Notes:
RedCloth is a module for using Textile in Ruby.
Textile is a text format.  A very simple text 
format.  Another stab at making readable text that
can be converted to HTML.

This release contains numerous new features which
make RedCloth better suited to Wikis (such as the
gorgeous Instiki product).  This version introduces
a safe mode, which can filter out html and/or css
from incoming Textile documents.  You can turn
on this feature either by passing in the
restrictions to RedCloth:

  textile = "h2{color: red}. Test <b>document</b>" +
            "<notextile></notextile>\n<b>"
  restrictions = [:filter_html, :filter_styles]

  RedCloth.new(textile, restrictions).to_html
  # => "<h2>Test &lt;b&gt;document&lt;/b&gt; <br />\n&lt;b&gt;</h2>" 

Alternatively, you can set the restrictions through
accessors to your RedCloth instance.

  textile = "h2{color: red}. Test <b>document</b>" +
            "<notextile></notextile>\n<b>"

  r = RedCloth.new(textile)
  r.filter_html = true
  r.filter_styles = true
  # => "<h2>Test &lt;b&gt;document&lt;/b&gt; <br />\n&lt;b&gt;</h2>" 

Thanks to Florian Gross for this marvelous patch!

This version also features line folding, as suggested
by Jim Menard.  Line folding allows RedCloth to
treat lines with a single newline between them
as a complete sentence.  Blank lines are then
treated as paragraph breaks.

An example:

  r = RedCloth.new( <<RED )
  RedCloth is a module for using Textile in Ruby.
  Textile is a text format.  A very simple text 
  format.  Another stab at making readable text that
  can be converted to HTML.

  This release contains numerous new features which
  make RedCloth better suited to Wikis (such as the
  gorgeous Instiki product).
  RED

  r.fold_lines = true
  r.to_html
  # => "<p>RedCloth is a module for using Textile
       in Ruby. Textile is a text format.  A very 
       simple text  format.  Another stab at 
       making readable text that can be converted 
       to <span class=\"caps\">HTML</span>.
       </p>\n\n\t<p>This release contains numerous
       new features which make RedCloth better 
       suited to Wikis (such as the gorgeous 
       Instiki product). </p>"

Jim sent in a number of bugfixes as well:

* Problem with em-dashes at the start of blocks.
* Footnotes were broken.

Thanks, Jim!


Changes: --- %YAML:1.0 - version: 2.0.5 date: 2004-04-14 changes: - Added safe mode (patch courtesy of Florian Gross). - Added line folding (suggested by Jim Menard). - Fixing notextile tags to work multi-line. - Ambiguity with em-dash and block opener. - Footnote bug. (Thanks, Jim Menard!)