Skip to content

Commit 4188181

Browse files
authored
Update web_src/js/markup/codecopy.ts
1 parent 0a4a29a commit 4188181

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

web_src/js/markup/codecopy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function initMarkupCodeCopy(elMarkup: HTMLElement): void {
1515
const btn = makeCodeCopyButton();
1616
// remove final trailing newline introduced during HTML rendering
1717
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.
1819
const btnContainer = el.closest('.code-block-container') ?? el.closest('.code-block');
1920
btnContainer.append(btn);
2021
});

0 commit comments

Comments
 (0)