Project

General

Profile

Defect #32971 » 32971-fixed-v4.patch

Yuichi HARADA, 2020-02-20 08:58

View differences:

lib/redmine/wiki_formatting/textile/redcloth3.rb
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
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
</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
(5-5/5)