Project

General

Profile

Actions

Defect #43801

open

Copy button appears only on the last pre when multiple pre blocks exist

Added by Mizuki ISHIKAWA about 5 hours ago. Updated about 5 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
UI
Target version:
-
Resolution:
Affected version:

Description

When a page contains multiple pre blocks, the copy button is displayed only on the last pre block.
Expected behavior: A copy button should be shown for each pre block.

This issue occurs after applying r24360 from issue #43643.

Actions #1

Updated by Mizuki ISHIKAWA about 5 hours ago

I think the following changes will resolve the issue.

diff --git a/lib/redmine/wiki_formatting/copypre_scrubber.rb b/lib/redmine/wiki_formatting/copypre_scrubber.rb
index 2afd02823..0157f9921 100644
--- a/lib/redmine/wiki_formatting/copypre_scrubber.rb
+++ b/lib/redmine/wiki_formatting/copypre_scrubber.rb
@@ -27,6 +27,7 @@ module Redmine
         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
+        @button.deep_dup
       end
     end
   end

Actions

Also available in: Atom PDF