From: Jean-Philippe Lang Date: Wed, 30 Jul 2008 18:28:01 +0000 (+0000) Subject: Fixed: RedCloth#block_markdown_rule freezes when parsing many hyphen marks (#1704). X-Git-Tag: 0.8.0-RC1~310 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3197814c623f3541bb8b66c11af70eeedbfbee52;p=redmine.git 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 59d02fbab..df19de22d 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 )