mirror of
https://github.com/redmine/redmine.git
synced 2026-01-21 23:13:04 +01:00
Merged r23726 from trunk to 6.0-stable (#42648).
git-svn-id: https://svn.redmine.org/redmine/branches/6.0-stable@23732 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -86,7 +86,7 @@ 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 == "a" && node["id"] =~ /\Afnref(-\d+){1,2}\z/
|
||||
return if node.name == "li" && node["id"] =~ /\Afn-\d+\z/
|
||||
|
||||
node.remove_attribute("id")
|
||||
|
||||
@@ -47,10 +47,14 @@ if Object.const_defined?(:CommonMarker)
|
||||
end
|
||||
|
||||
def test_should_support_footnotes
|
||||
input = %(<a href="#fn-1" id="fnref-1">foo</a>)
|
||||
assert_equal input, filter(input)
|
||||
input = %(<ol><li id="fn-1">footnote</li></ol>)
|
||||
assert_equal input, filter(input)
|
||||
[
|
||||
%(<a href="#fn-1" id="fnref-1">foo</a>),
|
||||
%(<a href="#fn-1" id="fnref-1-2">foo</a>),
|
||||
%(<ol><li id="fn-1">footnote</li></ol>),
|
||||
].each do |input|
|
||||
assert_equal input, filter(input)
|
||||
assert_equal input, filter(input)
|
||||
end
|
||||
end
|
||||
|
||||
def test_should_remove_invalid_ids
|
||||
|
||||
Reference in New Issue
Block a user