From 3197814c623f3541bb8b66c11af70eeedbfbee52 2008-07-30 18:28:01 From: Jean-Philippe Lang Date: 2008-07-30 18:28:01 Subject: [PATCH] Fixed: RedCloth#block_markdown_rule freezes when parsing many hyphen marks (#1704). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1710 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/redcloth.rb b/lib/redcloth.rb index 59d02fb..df19de2 100644 --- a/lib/redcloth.rb +++ b/lib/redcloth.rb @@ -744,7 +744,7 @@ class RedCloth < String end MARKDOWN_RULE_RE = /^(#{ - ['*', '-', '_'].collect { |ch| '( ?' + Regexp::quote( ch ) + ' ?){3,}' }.join( '|' ) + ['*', '-', '_'].collect { |ch| ' ?(' + Regexp::quote( ch ) + ' ?){3,}' }.join( '|' ) })$/ def block_markdown_rule( text )