Skip to content

Commit 738358c

Browse files
committed
fix(code-block): use bracket access for dataset code
1 parent e93f09b commit 738358c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/documentation/CodeBlock/CodeBlock.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const { code, language = 'text', title } = Astro.props;
1212
<script>
1313
document.querySelectorAll<HTMLButtonElement>('.copy-code').forEach((button) => {
1414
button.addEventListener('click', async () => {
15-
const code = button.dataset.code ?? '';
15+
const code = button.dataset['code'] ?? '';
1616
try {
1717
await navigator.clipboard.writeText(code);
1818
button.textContent = 'Copied';

0 commit comments

Comments
 (0)