Skip to content

Commit

Permalink
fix: copy code with extra new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud committed May 17, 2024
1 parent ac2cca9 commit 5789c9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions assets/css/_partial/_single/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ code:not(.chroma) {
a > code:not(.chroma) {
/* Inline code blocks inside links */
color: var(--single-link-color);
text-decoration: underline;
text-underline-offset: .2rem;
}


Expand Down
2 changes: 1 addition & 1 deletion assets/js/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ function initCodeblocks() {

// handle copying code to clipboard
copyCodeButton?.addEventListener("click", () => {
navigator.clipboard.writeText(chroma.innerText);
navigator.clipboard.writeText(chroma.textContent);
// toggle icons
copyIcon.style.display = "none";
checkIcon.style.display = "block";
Expand Down

0 comments on commit 5789c9b

Please sign in to comment.