summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2023-12-22 01:44:02 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2023-12-22 01:44:02 +0000
commit1f7f1a2db7f92750133faf95eb6f22f82ce337e7 (patch)
tree78566ec0afce3069190e5a7bee71d7dacf562957 /test
parent081d6c37132891817a585e499d77b24988dc3edd (diff)
downloadredmine-1f7f1a2db7f92750133faf95eb6f22f82ce337e7.tar.gz
redmine-1f7f1a2db7f92750133faf95eb6f22f82ce337e7.zip
Allow consecutive footnote references inTextile (#39884).
Patch by @hjust. git-svn-id: https://svn.redmine.org/redmine/trunk@22546 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
index c1923dd07..b3b81ae12 100644
--- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb
@@ -770,6 +770,23 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase
}, false)
end
+ def test_should_allow_multiple_footnotes
+ text = <<~STR
+ Some demo[1][2] And a sentence.[1]
+
+ fn1. One
+
+ fn2. Two
+ STR
+
+ expected = <<~EXPECTED
+ <p>Some demo<sup><a href="#fn1">1</a></sup><sup><a href="#fn2">2</a></sup> And a sentence.[1]</p>
+ <p id="fn1" class="footnote"><sup>1</sup> One</p>
+ <p id="fn2" class="footnote"><sup>2</sup> Two</p>
+ EXPECTED
+ assert_equal expected.gsub(%r{[\r\n\t]}, ''), to_html(text).gsub(%r{[\r\n\t]}, '')
+ end
+
private
def assert_html_output(to_test, expect_paragraph = true)