From: Jean-Philippe Lang Date: Sun, 28 Dec 2008 10:12:09 +0000 (+0000) Subject: Fixed bold syntax around single character in series (#2351). X-Git-Tag: 0.9.0~845 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a140c9bd7480c2ac93f22063575fb99ebf654be6;p=redmine.git 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 038522a89..69332395b 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 d2d1a1f19..261614d3f 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