Project

General

Profile

Patch #28207 » 0001-Add-footnotes-test-for-markdown-formatter-16072.patch

Mischa The Evil, 2018-02-17 23:56

View differences:

test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb
98 98
    assert_equal "<p>This is a list:</p>\n\n<ul>\n<li>One</li>\n<li>Two</li>\n</ul>", @formatter.new(text).to_html.strip
99 99
  end
100 100

  
101
  def test_footnotes
102
    text = <<-STR
103
This is some text[^1].
104

  
105
[^1]: This is the foot note
106
STR
107

  
108
    expected = <<-EXPECTED
109
<p>This is some text<sup id="fnref1"><a href="#fn1" rel="footnote">1</a></sup>.</p>
110
<div class="footnotes">
111
<hr>
112
<ol>
113

  
114
<li id="fn1">
115
<p>This is the foot note&nbsp;<a href="#fnref1" rev="footnote">&#8617;</a></p>
116
</li>
117

  
118
</ol>
119
</div>
120
EXPECTED
121

  
122
    assert_equal expected.gsub(%r{[\r\n\t]}, ''), @formatter.new(text).to_html.gsub(%r{[\r\n\t]}, '')
123
  end
124

  
101 125
  end
102 126
end
(1-1/2)