Skip to content

Commit

Permalink
Persist attributes defined on code blocks (#13)
Browse files Browse the repository at this point in the history
* Add matching id to code/button parent

* Persist attributes defined on code blocks
  • Loading branch information
joepavitt authored Sep 28, 2024
1 parent 76877d9 commit 8307f55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function renderCode(origRule, rendererOptions) {
return origRendered;
}
return `
<div style="position: relative">
<div style="position: relative" id="code-container-${idx}" ${self.renderAttrs(tokens[idx])}>
${origRendered.replace(/<code/, `<code id="code-${idx}"`)}
<button class="${rendererOptions.buttonClass} ${rendererOptions.additionalButtonClass}"
data-clipboard-target="#code-${idx}"
Expand Down

0 comments on commit 8307f55

Please sign in to comment.