mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Add footnotes test for markdown formatter (#28207).
Patch by Mischa The Evil. git-svn-id: http://svn.redmine.org/redmine/trunk@17221 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
7ca9f6f1cb
commit
8d033d08d0
@ -98,5 +98,29 @@ STR
|
|||||||
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
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_footnotes
|
||||||
|
text = <<-STR
|
||||||
|
This is some text[^1].
|
||||||
|
|
||||||
|
[^1]: This is the foot note
|
||||||
|
STR
|
||||||
|
|
||||||
|
expected = <<-EXPECTED
|
||||||
|
<p>This is some text<sup id="fnref1"><a href="#fn1" rel="footnote">1</a></sup>.</p>
|
||||||
|
<div class="footnotes">
|
||||||
|
<hr>
|
||||||
|
<ol>
|
||||||
|
|
||||||
|
<li id="fn1">
|
||||||
|
<p>This is the foot note <a href="#fnref1" rev="footnote">↩</a></p>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
EXPECTED
|
||||||
|
|
||||||
|
assert_equal expected.gsub(%r{[\r\n\t]}, ''), @formatter.new(text).to_html.gsub(%r{[\r\n\t]}, '')
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user