summaryrefslogtreecommitdiffstats
path: root/test/unit/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-12 13:43:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-12 13:43:11 +0000
commit24b4c5f48dc0a8cf7896efe8cd205b1f506d8c19 (patch)
tree9802daa80620031e3eb561d73f6c913ec8b9db43 /test/unit/lib
parent6ea1ef77e5e54dc19bc3e2987852e101cb64a5cf (diff)
downloadredmine-24b4c5f48dc0a8cf7896efe8cd205b1f506d8c19.tar.gz
redmine-24b4c5f48dc0a8cf7896efe8cd205b1f506d8c19.zip
Fixed: text formatting breaks when using parenthesis inside bold tags (#1334).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3563 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib')
-rw-r--r--test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
index 49a75cd0f..8cb98ba51 100644
--- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
@@ -32,6 +32,24 @@ class Redmine::WikiFormatting::TextileFormatterTest < HelperTestCase
"~" => 'sub' # subscript
}
+ def test_modifiers
+ to_test = {
+ '*bold*' => '<strong>bold</strong>',
+ 'before *bold*' => 'before <strong>bold</strong>',
+ '*bold* after' => '<strong>bold</strong> after',
+ '*two words*' => '<strong>two words</strong>',
+ '*two*words*' => '<strong>two*words</strong>',
+ '*two * words*' => '<strong>two * words</strong>',
+ '*two* *words*' => '<strong>two</strong> <strong>words</strong>',
+ '*(two)* *(words)*' => '<strong>(two)</strong> <strong>(words)</strong>',
+ # with class
+ '*(foo)two words*' => '<strong class="foo">two words</strong>',
+ }
+ to_test.each do |text, expected|
+ assert_equal "<p>#{expected}</p>", @formatter.new(text).to_html
+ end
+ end
+
def test_modifiers_combination
MODIFIERS.each do |m1, tag1|
MODIFIERS.each do |m2, tag2|