@@ -456,7 +456,7 class RedCloth3 < String | |||
|
456 | 456 | # next if tog and method( tog ).call |
|
457 | 457 | # text.gsub! re, resub |
|
458 | 458 | #end |
|
459 |
text.gsub!(/\b([A-Z][A-Z0-9]{ |
|
|
459 | text.gsub!(/\b([A-Z][A-Z0-9]{1,})\b(?:[(]([^)]*)[)])/) do |m| | |
|
460 | 460 | "<acronym title=\"#{htmlesc $2}\">#{$1}</acronym>" |
|
461 | 461 | end |
|
462 | 462 | end |
@@ -116,15 +116,6 RAW | |||
|
116 | 116 | assert textilizable(raw).include?('<img src="bar.gif" alt="" />') |
|
117 | 117 | end |
|
118 | 118 | |
|
119 | def test_acronyms | |
|
120 | to_test = { | |
|
121 | 'this is an acronym: GPL(General Public License)' => 'this is an acronym: <acronym title="General Public License">GPL</acronym>', | |
|
122 | 'GPL(This is a double-quoted "title")' => '<acronym title="This is a double-quoted "title"">GPL</acronym>', | |
|
123 | } | |
|
124 | to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } | |
|
125 | ||
|
126 | end | |
|
127 | ||
|
128 | 119 | def test_attached_images |
|
129 | 120 | to_test = { |
|
130 | 121 | 'Inline image: !logo.gif!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />', |
@@ -401,11 +392,6 EXPECTED | |||
|
401 | 392 | assert_equal '<p>Dashes: ---</p>', textilizable('Dashes: ---') |
|
402 | 393 | end |
|
403 | 394 | |
|
404 | def test_acronym | |
|
405 | assert_equal '<p>This is an acronym: <acronym title="American Civil Liberties Union">ACLU</acronym>.</p>', | |
|
406 | textilizable('This is an acronym: ACLU(American Civil Liberties Union).') | |
|
407 | end | |
|
408 | ||
|
409 | 395 | def test_footnotes |
|
410 | 396 | raw = <<-RAW |
|
411 | 397 | This is some text[1]. |
@@ -78,6 +78,14 class Redmine::WikiFormatting::TextileFormatterTest < HelperTestCase | |||
|
78 | 78 | ) |
|
79 | 79 | end |
|
80 | 80 | |
|
81 | def test_acronyms | |
|
82 | assert_html_output( | |
|
83 | 'this is an acronym: GPL(General Public License)' => 'this is an acronym: <acronym title="General Public License">GPL</acronym>', | |
|
84 | '2 letters JP(Jean-Philippe) acronym' => '2 letters <acronym title="Jean-Philippe">JP</acronym> acronym', | |
|
85 | 'GPL(This is a double-quoted "title")' => '<acronym title="This is a double-quoted "title"">GPL</acronym>' | |
|
86 | ) | |
|
87 | end | |
|
88 | ||
|
81 | 89 | private |
|
82 | 90 | |
|
83 | 91 | def assert_html_output(to_test) |
General Comments 0
You need to be logged in to leave comments.
Login now