mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-06 09:03:25 +00:00
Newline between list items break a list (#32971).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@19536 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c6ed9070e7
commit
2253032ebc
@ -1020,11 +1020,12 @@ class RedCloth3 < String
|
||||
end
|
||||
|
||||
def flush_left( text )
|
||||
indt = 0
|
||||
if text =~ /^ /
|
||||
unless text.empty?
|
||||
indt += 1 while text !~ /^ {#{indt}}[^ ]/
|
||||
end
|
||||
if /(?![\r\n\t ])[[:cntrl:]]/.match?(text)
|
||||
text.gsub!(/(?![\r\n\t ])[[:cntrl:]]/, '')
|
||||
end
|
||||
if /^ +\S/.match?(text)
|
||||
indt = 0
|
||||
indt += 1 while !/^ {#{indt}}\S/.match?(text)
|
||||
if indt.nonzero?
|
||||
text.gsub!( /^ {#{indt}}/, '' )
|
||||
end
|
||||
|
||||
@ -171,6 +171,24 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase
|
||||
</ol>
|
||||
EXPECTED
|
||||
assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '')
|
||||
|
||||
raw = <<~RAW
|
||||
* Item-1
|
||||
|
||||
* Item-1a
|
||||
* Item-1b
|
||||
RAW
|
||||
expected = <<~EXPECTED
|
||||
<ul>
|
||||
<li>Item-1
|
||||
<ul>
|
||||
<li>Item-1a</li>
|
||||
<li>Item-1b</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
EXPECTED
|
||||
assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '')
|
||||
end
|
||||
|
||||
def test_escaping
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user