@@ -585,7 +585,7 class RedCloth3 < String | |||||
585 | last_line = line_id |
|
585 | last_line = line_id | |
586 | end |
|
586 | end | |
587 | if line_id - last_line > 1 or line_id == lines.length - 1 |
|
587 | if line_id - last_line > 1 or line_id == lines.length - 1 | |
588 |
depth. |
|
588 | while v = depth.pop | |
589 | lines[last_line] << "</li>\n\t</#{ lT( v ) }l>" |
|
589 | lines[last_line] << "</li>\n\t</#{ lT( v ) }l>" | |
590 | end |
|
590 | end | |
591 | end |
|
591 | end |
@@ -110,6 +110,36 class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase | |||||
110 | ) |
|
110 | ) | |
111 | end |
|
111 | end | |
112 |
|
112 | |||
|
113 | def test_nested_lists | |||
|
114 | raw = <<-RAW | |||
|
115 | # Item 1 | |||
|
116 | # Item 2 | |||
|
117 | ** Item 2a | |||
|
118 | ** Item 2b | |||
|
119 | # Item 3 | |||
|
120 | ** Item 3a | |||
|
121 | RAW | |||
|
122 | ||||
|
123 | expected = <<-EXPECTED | |||
|
124 | <ol> | |||
|
125 | <li>Item 1</li> | |||
|
126 | <li>Item 2 | |||
|
127 | <ul> | |||
|
128 | <li>Item 2a</li> | |||
|
129 | <li>Item 2b</li> | |||
|
130 | </ul> | |||
|
131 | </li> | |||
|
132 | <li>Item 3 | |||
|
133 | <ul> | |||
|
134 | <li>Item 3a</li> | |||
|
135 | </ul> | |||
|
136 | </li> | |||
|
137 | </ol> | |||
|
138 | EXPECTED | |||
|
139 | ||||
|
140 | assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '') | |||
|
141 | end | |||
|
142 | ||||
113 | def test_escaping |
|
143 | def test_escaping | |
114 | assert_html_output( |
|
144 | assert_html_output( | |
115 | 'this is a <script>' => 'this is a <script>' |
|
145 | 'this is a <script>' => 'this is a <script>' |
General Comments 0
You need to be logged in to leave comments.
Login now