From 8d033d08d0e7ec6a9631a35dc25027fe16adb131 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 2 Mar 2018 04:55:52 +0000 Subject: [PATCH] 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 --- .../markdown_formatter_test.rb | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) 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 "

This is a list:

\n\n", @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 +

This is some text1.

+
+
+
    + +
  1. +

    This is the foot note 

    +
  2. + +
+
+EXPECTED + + assert_equal expected.gsub(%r{[\r\n\t]}, ''), @formatter.new(text).to_html.gsub(%r{[\r\n\t]}, '') + end + end end -- 2.39.5