From a140c9bd7480c2ac93f22063575fb99ebf654be6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 28 Dec 2008 10:12:09 +0000 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 --- lib/redcloth3.rb | 4 ++-- test/unit/helpers/application_helper_test.rb | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index 038522a8..69332395 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 d2d1a1f1..261614d3 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