From e09426552ce2420fd214d097f050a3c33966de66 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sat, 28 May 2022 09:42:15 +0000 Subject: [PATCH] Update footnotes markup after commonmarker gem update (#35892). git-svn-id: https://svn.redmine.org/redmine/trunk@21612 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../wiki_formatting/common_mark/sanitization_filter.rb | 4 ++-- .../redmine/wiki_formatting/common_mark/formatter_test.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb b/lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb index 9c1dee13a..7fef35bfa 100644 --- a/lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb +++ b/lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb @@ -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") } diff --git a/test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb index ee46e5d8e..2eeb28759 100644 --- a/test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb @@ -148,10 +148,10 @@ class Redmine::WikiFormatting::CommonMark::FormatterTest < ActionView::TestCase STR expected = <<~EXPECTED -

This is some text1.

+

This is some text1.

    -
  1. -

    This is the foot note ↩

    +
  2. +

    This is the foot note ↩

EXPECTED -- 2.39.5