We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d475bad commit 22807f5Copy full SHA for 22807f5
1 file changed
docs/src/code.js
@@ -117,7 +117,9 @@ function addCodeCopyButtons() {
117
118
function copyCodeFor(codeElement) {
119
return () => {
120
- navigator.clipboard.writeText(codeElement.textContent);
+ const clone = codeElement.cloneNode(true);
121
+ clone.querySelectorAll('.btnCopyCode').forEach(btn => btn.remove());
122
+ navigator.clipboard.writeText(clone.textContent);
123
124
const success = addButton('✅', codeElement);
125
success.disabled = true;
@@ -135,6 +137,7 @@ function addCodeCopyButtons() {
135
137
btn.style.top = '11.5px';
136
138
btn.style.right = '15px';
139
btn.textContent = txt;
140
+ btn.classList.add('btnCopyCode');
141
142
parent.appendChild(btn);
143
0 commit comments