summaryrefslogtreecommitdiffstats
path: root/test/unit/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-03-02 04:55:52 +0000
committerGo MAEDA <maeda@farend.jp>2018-03-02 04:55:52 +0000
commit8d033d08d0e7ec6a9631a35dc25027fe16adb131 (patch)
tree503b7b5708a49a05fcef4262e10c72e8128c07ef /test/unit/lib
parent7ca9f6f1cbf60b1eea5cedf2916b74108f6ae066 (diff)
downloadredmine-8d033d08d0e7ec6a9631a35dc25027fe16adb131.tar.gz
redmine-8d033d08d0e7ec6a9631a35dc25027fe16adb131.zip
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
Diffstat (limited to 'test/unit/lib')
-rw-r--r--test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb
index 3acf29d70..04083dd0f 100644
--- a/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb
@@ -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
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&nbsp;<a href="#fnref1" rev="footnote">&#8617;</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