Skip to content

Commit 847b4ce

Browse files
author
armandocumate
committed
update for hidden only on clipboard
1 parent 056a46c commit 847b4ce

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/theme/book.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
window.onunload = function () { };
55

66
// Global variable, shared between modules
7-
function playground_text(playground) {
7+
function playground_text(playground, hidden = true) {
88
let code_block = playground.querySelector("code");
99

1010
if (window.ace && code_block.classList.contains("editable")) {
1111
let editor = window.ace.edit(code_block);
1212
return editor.getValue();
13-
} else {
14-
return code_block.textContent;
13+
} else if (hidden) {
14+
code_block.textContent;
15+
} else{
16+
return code_block.innerText;
1517
}
1618
}
1719

@@ -592,7 +594,7 @@ function playground_text(playground) {
592594
text: function (trigger) {
593595
hideTooltip(trigger);
594596
let playground = trigger.closest("pre");
595-
return playground_text(playground);
597+
return playground_text(playground, false);
596598
}
597599
});
598600

0 commit comments

Comments
 (0)