From 74c6f2bcfb1ca3391c2134e4e3425409b1c11939 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Thu, 30 Mar 2023 14:03:48 +0100 Subject: [PATCH] Fix clipboard code (#38380) --- site/assets/js/code-examples.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/assets/js/code-examples.js b/site/assets/js/code-examples.js index f224500f47..e1f680e7e9 100644 --- a/site/assets/js/code-examples.js +++ b/site/assets/js/code-examples.js @@ -53,7 +53,7 @@ const clipboard = new ClipboardJS('.btn-clipboard', { target: trigger => trigger.closest('.bd-code-snippet').querySelector('.highlight'), - text: trigger => trigger.parentNode.nextElementSibling.textContent.trimEnd() + text: trigger => trigger.closest('.bd-code-snippet').querySelector('.highlight').textContent.trimEnd() }) clipboard.on('success', event => {