From a140c9bd7480c2ac93f22063575fb99ebf654be6 2008-12-28 10:12:09 From: Jean-Philippe Lang Date: 2008-12-28 10:12:09 Subject: [PATCH] Fixed bold syntax around single character in series (#2351). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2191 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index 038522a..6933239 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -382,14 +382,14 @@ class RedCloth3 < String (#{rcq}) (#{C}) (?::(\S+?))? - ([^\s\-].*?[^\s\-]|\w) + (\w|[^\s\-].*?[^\s\-]) #{rcq} (?=[[:punct:]]|\s|\)|$)/x else /(#{rcq}) (#{C}) (?::(\S+))? - ([^\s\-].*?[^\s\-]|\w) + (\w|[^\s\-].*?[^\s\-]) #{rcq}/xm end [rc, ht, re, rtype] diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index d2d1a1f..261614d 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -251,7 +251,10 @@ EXPECTED def test_text_formatting to_test = {'*_+bold, italic and underline+_*' => 'bold, italic and underline', - '(_text within parentheses_)' => '(text within parentheses)' + '(_text within parentheses_)' => '(text within parentheses)', + 'a *Humane Web* Text Generator' => 'a Humane Web Text Generator', + 'a H *umane* W *eb* T *ext* G *enerator*' => 'a H umane W eb T ext G enerator', + 'a *H* umane *W* eb *T* ext *G* enerator' => 'a H umane W eb T ext G enerator', } to_test.each { |text, result| assert_equal "

#{result}

", textilizable(text) } end