summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarmandocumate <armando@documate.org>2022-12-13 15:22:03 -0800
committerEric Huss <eric@huss.org>2022-12-14 06:54:45 -0800
commitcf1557e4543f302c24885d4eca71db950bcd25f2 (patch)
treedbc9d2f31527dec37b9cb43b337f7e0aa6c74ae5
parent36e1f0109126cdf1137326e27bddc0b05a78293b (diff)
update for hidden only on clipboard
-rw-r--r--src/theme/book.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/theme/book.js b/src/theme/book.js
index a48ebcd2..e303ebb4 100644
--- a/src/theme/book.js
+++ b/src/theme/book.js
@@ -4,12 +4,14 @@
window.onunload = function () { };
// Global variable, shared between modules
-function playground_text(playground) {
+function playground_text(playground, hidden = true) {
let code_block = playground.querySelector("code");
if (window.ace && code_block.classList.contains("editable")) {
let editor = window.ace.edit(code_block);
return editor.getValue();
+ } else if (hidden) {
+ return code_block.textContent;
} else {
return code_block.innerText;
}
@@ -599,7 +601,7 @@ function playground_text(playground) {
text: function (trigger) {
hideTooltip(trigger);
let playground = trigger.closest("pre");
- return playground_text(playground);
+ return playground_text(playground, false);
}
});