We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a4a29a commit 4188181Copy full SHA for 4188181
web_src/js/markup/codecopy.ts
@@ -15,6 +15,7 @@ export function initMarkupCodeCopy(elMarkup: HTMLElement): void {
15
const btn = makeCodeCopyButton();
16
// remove final trailing newline introduced during HTML rendering
17
btn.setAttribute('data-clipboard-text', el.textContent.replace(/\r?\n$/, ''));
18
+ // we only want to use `.code-block-container` if it exists, no matter `.code-block` exists or not.
19
const btnContainer = el.closest('.code-block-container') ?? el.closest('.code-block');
20
btnContainer.append(btn);
21
});
0 commit comments