[ANN] RedCloth 3.0.1 -- Humane Text for Ruby

  • Thread starter why the lucky stiff
  • Start date
W

why the lucky stiff

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
 
B

Bil Kleb

why said:
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,
 
A

Alexey Verkhovsky

Bil said:
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)
 
W

why the lucky stiff

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

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
 
B

Bil Kleb

why said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top