##// END OF EJS Templates
Fixed that textile nested lists are not properly closed in output (#10642)....
Jean-Philippe Lang -
r9296:2cc294aa27a2
parent child
Show More
@@ -585,7 +585,7 class RedCloth3 < String
585 585 last_line = line_id
586 586 end
587 587 if line_id - last_line > 1 or line_id == lines.length - 1
588 depth.delete_if do |v|
588 while v = depth.pop
589 589 lines[last_line] << "</li>\n\t</#{ lT( v ) }l>"
590 590 end
591 591 end
@@ -110,6 +110,36 class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase
110 110 )
111 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 143 def test_escaping
114 144 assert_html_output(
115 145 'this is a <script>' => 'this is a &lt;script&gt;'
General Comments 0
You need to be logged in to leave comments. Login now