From 66f8e0caf0b93ea6ca1db168efcbcf7056f5436c Mon Sep 17 00:00:00 2001 From: Mischa The Evil Date: Sat, 17 Feb 2018 22:07:23 +0100 Subject: [PATCH 1/2] Add footnotes test for markdown formatter (#16072). --- .../wiki_formatting/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 3acf29d..04083dd 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 -- 1.9.1