]> source.dussan.org Git - redmine.git/commitdiff
Merged r21612 to 5.0-stable (35892).
authorMarius Balteanu <marius.balteanu@zitec.com>
Sat, 28 May 2022 09:59:39 +0000 (09:59 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Sat, 28 May 2022 09:59:39 +0000 (09:59 +0000)
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21617 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb
test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb

index 9c1dee13ae6c44b654dedf870d2776f9134ed708..7fef35bfae6c6e4547b1fe3a203f6b73fd7e7db1 100644 (file)
@@ -71,8 +71,8 @@ module Redmine
             node = env[:node]
             return unless node.name == "a" || node.name == "li"
             return unless node.has_attribute?("id")
-            return if node.name == "a" && node["id"] =~ /\Afnref\d+\z/
-            return if node.name == "li" && node["id"] =~ /\Afn\d+\z/
+            return if node.name == "a" && node["id"] =~ /\Afnref-\d+\z/
+            return if node.name == "li" && node["id"] =~ /\Afn-\d+\z/
 
             node.remove_attribute("id")
           }
index ee46e5d8e16d9e5fbc4aa39eefeb18ea62f3b44f..2eeb28759d51d4f114df9d1876d3cdc0b83eb68a 100644 (file)
@@ -148,10 +148,10 @@ class Redmine::WikiFormatting::CommonMark::FormatterTest < ActionView::TestCase
       STR
 
       expected = <<~EXPECTED
-        <p>This is some text<sup><a href="#fn1" id="fnref1">1</a></sup>.</p>
+        <p>This is some text<sup><a href="#fn-1" id="fnref-1">1</a></sup>.</p>
          <ol>
-        <li id="fn1">
-        <p>This is the foot note <a href="#fnref1">↩</a></p>
+        <li id="fn-1">
+        <p>This is the foot note <a href="#fnref-1" aria-label=\"Back to content\">↩</a></p>
         </li>
         </ol>
       EXPECTED