Fixed: bold, italics, underline not working within parentheses (#1225).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1434 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
439c697237
commit
1907c31138
@ -376,13 +376,13 @@ class RedCloth < String
|
|||||||
re =
|
re =
|
||||||
case rtype
|
case rtype
|
||||||
when :limit
|
when :limit
|
||||||
/(^|[>\s])
|
/(^|[>\s\(])
|
||||||
(#{rcq})
|
(#{rcq})
|
||||||
(#{C})
|
(#{C})
|
||||||
(?::(\S+?))?
|
(?::(\S+?))?
|
||||||
([^\s\-].*?[^\s\-]|\w)
|
([^\s\-].*?[^\s\-]|\w)
|
||||||
#{rcq}
|
#{rcq}
|
||||||
(?=[[:punct:]]|\s|$)/x
|
(?=[[:punct:]]|\s|\)|$)/x
|
||||||
else
|
else
|
||||||
/(#{rcq})
|
/(#{rcq})
|
||||||
(#{C})
|
(#{C})
|
||||||
|
@ -162,6 +162,13 @@ class ApplicationHelperTest < HelperTestCase
|
|||||||
to_test.each { |text, result| assert_equal "<table>#{result}</table>", textilizable(text).gsub(/[\t\n]/, '') }
|
to_test.each { |text, result| assert_equal "<table>#{result}</table>", textilizable(text).gsub(/[\t\n]/, '') }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_text_formatting
|
||||||
|
to_test = {'*_+bold, italic and underline+_*' => '<strong><em><ins>bold, italic and underline</ins></em></strong>',
|
||||||
|
'(_text within parentheses_)' => '(<em>text within parentheses</em>)'
|
||||||
|
}
|
||||||
|
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
|
||||||
|
end
|
||||||
|
|
||||||
def test_wiki_horizontal_rule
|
def test_wiki_horizontal_rule
|
||||||
assert_equal '<hr />', textilizable('---')
|
assert_equal '<hr />', textilizable('---')
|
||||||
assert_equal '<p>Dashes: ---</p>', textilizable('Dashes: ---')
|
assert_equal '<p>Dashes: ---</p>', textilizable('Dashes: ---')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user