From bbba46c41b656579958b25e769a222e750bd4558 Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Sat, 1 May 2021 21:20:41 +0200 Subject: [PATCH] fix(clipboard): copy of multiple rules was broken --- assets/js/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index c21713c..652460c 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -3,14 +3,14 @@ $(function () { text: function (trigger) { const id = trigger.getAttribute('data-clipboard-target-id'); const html = $("#" + id + " .highlight"); - return html.text(); + return html.text() + '\n'; }, }); var clipboardCategories = new ClipboardJS('.clipboard-multiple', { text: function (trigger) { const id = trigger.getAttribute('data-clipboard-target-id'); const html = $("[id^=" + id + "] .highlight"); - return html.append("\n\n").text(); + return Array.from(html.map((i, target) => $(target).text())).join('\n\n'); }, }); -}); \ No newline at end of file +});