[ANN] RedCloth 3.0.1 -- Humane Text for Ruby

RedCloth 3 lumbers along.

RedCloth is a Ruby library for writing stylized text which can be converted into HTML. The parser includes built-in Textile and limited Markdown support.

This release is a maintenance release. Fixed some stack overflows on regular expressions, relaxed parsing of emphasis tokens, and improved use of <notextile> tags. Be aware, there are still some known overflows and wierdnesses. If you're looking for stability, I'd stick with 2.0.11 until 3.1 comes out.

_why

why the lucky stiff wrote:

RedCloth 3 lumbers along.

I keep withholding information. Sorry. <http://whytheluckystiff.net/ruby/redcloth/&gt;

_why

why the lucky stiff wrote:

RedCloth 3 lumbers along.

Excellent news. Thank you.

If you're looking for stability, I'd stick with 2.0.11 until 3.1 comes out.

  /usr/local/pkgs/ruby-1.8.2/lib/ruby/gems/1.8/gems/RedCloth-3.0.1/lib/redcloth.rb:571:in `gsub!': Stack overflow in regexp matcher: /((?:^([#*> ])(?:[^\n]|\n+(?:\2|>)|\n(?!\n|\Z))+))|((?:[^\n]+|\n+ +|\n(?![#*\n]|\Z))+)/m (RegexpError)
         from /usr/local/pkgs/ruby-1.8.2/lib/ruby/gems/1.8/gems/RedCloth-3.0.1/lib/redcloth.rb:571:in `blocks'

Standing by at 2.0.11,

···

--
Bil Kleb, Hampton, Virginia
http://fun3d.larc.nasa.gov

why the lucky stiff wrote:

RedCloth 3 lumbers along.

FWIW, I was running with Ruby's -w tonight and came up with
the patch following my sig to quiet things down (and repair
a couple typos).

I'll try to come up with some test cases that demonstrate
my particular breed of stack overflows.

BTW: several tests do not pass for this release? (Most failures
seem to be related to newline treatment.)

Regards,

···

--
Bil Kleb, Hampton, Virginia
http://fun3d.larc.nasa.gov

$ diff -Naur redcloth-3.0.1.rb redcloth.rb
--- redcloth-3.0.1.rb 2005-01-20 15:48:04.000000000 -0500
+++ redcloth.rb 2005-01-20 18:15:10.000000000 -0500
@@ -133,7 +133,7 @@
  #
  # == Adding Tables
  #
-# In Textile, simple tables can be added by seperating each column by
+# In Textile, simple tables can be added by separating each column by
  # a pipe.
  #
  # |a|simple|table|row|
@@ -194,7 +194,7 @@
      attr_accessor :hard_breaks

      #
- # Establishes the markup predence. Available rules include:
+ # Establishes the markup precedence. Available rules include:
      #
      # == Textile Rules
      #
@@ -230,6 +230,7 @@
      # #=>"<h1>A &lt;b&gt;bold&lt;/b&gt; man</h1>"
      #
      def initialize( string, restrictions = )
+ @filter_html = @filter_styles = nil
          restrictions.each { |r| method( "#{ r }=" ).call( true ) }
          super( string )
      end
@@ -594,7 +595,7 @@

                      block_applied = nil
                      @rules.each do |rule_name|
- break if block_applied = ( rule_name.to_s.match /^block_/ and method( rule_name ).call( blk ) )
+ break if block_applied = ( rule_name.to_s.match(/^block_/) and method( rule_name ).call( blk ) )
                      end
                      unless block_applied
                          if deep_code
@@ -704,9 +705,6 @@
      def block_markdown_lists( text )
      end

- def inline_markdown_link( text )
- end
-
      def inline_textile_span( text )
          text.gsub!( QTAGS_RE_1 ) do |m|

@@ -818,7 +816,7 @@

      def refs( text )
          @rules.each do |rule_name|
- method( rule_name ).call( text ) if rule_name.to_s.match /^refs_/
+ method( rule_name ).call( text ) if rule_name.to_s.match( /^refs_/ )
          end
      end

@@ -1022,7 +1020,7 @@

      def inline( text )
          @rules.each do |rule_name|
- method( rule_name ).call( text ) if rule_name.to_s.match /^inline_/
+ method( rule_name ).call( text ) if rule_name.to_s.match( /^inline_/ )
          end
      end

Bil Kleb wrote:

Standing by at 2.0.11,

On the other hand, RedCloth 3 fixes a number of interesting rendering bugs with punctuation and hyphens rendering.

For example, try to feed both versions with this:

* "a~": b
* "c": ~d

and you'll know what I am talking about.

Dear Why, a stable 3.X release is exactly what the progressive humankind needs.

···

--
Best regards,

Alexey Verkhovsky

Ruby Forum: http://ruby-forum.org (moderator)
RForum: http://rforum.andreas-s.net (co-author)
Instiki: http://instiki.org (maintainer)

Believe me when I say that I am just as vested as you are in wanting this.
My book, my notes, my blogs. All wrapped up in this stuff.

_why

···

Alexey Verkhovsky (alex@verk.info) wrote:

Dear Why, a stable 3.X release is exactly what the progressive humankind
needs.