@@ -341,7 +341,7 class RedCloth3 < String | |||
|
341 | 341 | A_HLGN = /(?:(?:<>|<|>|\=|[()]+)+)/ |
|
342 | 342 | A_VLGN = /[\-^~]/ |
|
343 | 343 | C_CLAS = '(?:\([^")]+\))' |
|
344 |
C_LNGE = '(?:\[[ |
|
|
344 | C_LNGE = '(?:\[[a-z\-_]+\])' | |
|
345 | 345 | C_STYL = '(?:\{[^"}]+\})' |
|
346 | 346 | S_CSPN = '(?:\\\\\d+)' |
|
347 | 347 | S_RSPN = '(?:/\d+)' |
@@ -480,7 +480,7 class RedCloth3 < String | |||
|
480 | 480 | end |
|
481 | 481 | |
|
482 | 482 | lang = $1 if |
|
483 |
text.sub!( /\[([ |
|
|
483 | text.sub!( /\[([a-z\-_]+?)\]/, '' ) | |
|
484 | 484 | |
|
485 | 485 | cls = $1 if |
|
486 | 486 | text.sub!( /\(([^()]+?)\)/, '' ) |
@@ -110,6 +110,20 class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase | |||
|
110 | 110 | ) |
|
111 | 111 | end |
|
112 | 112 | |
|
113 | def test_lang_attribute | |
|
114 | assert_html_output( | |
|
115 | '*[fr]French*' => '<strong lang="fr">French</strong>', | |
|
116 | '*[fr-fr]French*' => '<strong lang="fr-fr">French</strong>', | |
|
117 | '*[fr_fr]French*' => '<strong lang="fr_fr">French</strong>' | |
|
118 | ) | |
|
119 | end | |
|
120 | ||
|
121 | def test_lang_attribute_should_ignore_invalid_value | |
|
122 | assert_html_output( | |
|
123 | '*[fr3]French*' => '<strong>[fr3]French</strong>' | |
|
124 | ) | |
|
125 | end | |
|
126 | ||
|
113 | 127 | def test_nested_lists |
|
114 | 128 | raw = <<-RAW |
|
115 | 129 | # Item 1 |
General Comments 0
You need to be logged in to leave comments.
Login now