Fixes copy button appears only on the last pre when multiple pre blocks exist (#43801, #42737).

git-svn-id: https://svn.redmine.org/redmine/trunk@24413 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2026-02-15 03:32:09 +00:00
parent bf2e86da80
commit 67e70905d5

View File

@@ -26,7 +26,7 @@ module Redmine
icon = ApplicationController.helpers.sprite_icon('copy-pre-content', size: 18)
button_copy = ApplicationController.helpers.l(:button_copy)
html = '<a class="copy-pre-content-link icon-only" title="' + button_copy + '" data-action="clipboard#copyPre">' + icon + '</a>'
@button ||= Nokogiri::HTML5.fragment(html).children.first
Nokogiri::HTML5.fragment(html).children.first
end
end
end