why the lucky stiff
11/9/2004 11:30:00 PM
Stephan Kämper wrote:
> C:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.0/lib/redcloth.rb:566:in
> `gsub!': Stack overflow in regexp matcher: /((?:\n*[\#
> ](?:[^\n]|\n+[\# ]|\n(?!\n|\Z))+)|(?:\n*[\* ](?:[^\n]|\n+[\*
> ]|\n(?!\n|\Z))+)|(?:\n*[> ](?:[^\n]|\n+[>
> ]|\n(?!\n|\Z))+))|((?:[^\n]+|\n+ +|\n(?![#*\n]|\Z))+)/m (RegexpError)
> from
> C:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.0/lib/redcloth.rb:566:in
> `blocks'
> from
> C:/ruby/lib/ruby/gems/1.8/gems/RedCloth-3.0.0/lib/redcloth.rb:276:in
> `to_html'
> from E:/stephan/source/zz_delete-me/rc_3.rb:6
Try the patch below. Also, for simple transformations like the one
you're doing, you might try the new `redcloth' command line tool, which
simply runs a transformation on a provided text file.
stungun$ redcloth test.rdcl
Thanks for reporting this right away. The new RedCloth 3.0 needs
testing and beating up. Some Markdown stuff just simply doesn't work,
other things work wrong, and still other things are just sordid and I
won't discuss them here in the presence of professionals.
_why
===================================================================
RCS file: /var/cvs/redcloth/redcloth/lib/redcloth.rb,v
retrieving revision 1.46
diff -r1.46 redcloth.rb
558,563c558
< BLOCKS_GROUP_RE = /(#{
< ['#', '*', '>'].collect do |sym|
< sym = Regexp::quote( sym )
< '(?:\n*[' + sym + ' ](?:[^\n]|\n+[' + sym + '
]|\n(?!\n|\Z))+)'
< end.join '|'
< })|((?:[^\n]+|\n+ +|\n(?![#*\n]|\Z))+)/m
---
> BLOCKS_GROUP_RE = /((?:\n*([#*>
])(?:[^\n]|\n+\2|\n(?!\n|\Z))+))|((?:[^\n]+|\n+ +|\n(?![#*\n]|\Z))+)/m
567c562
< plain = $2 ? true : false
---
> plain = $3 ? true : false