| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | ||
| 2 | 2 | const loadCopyButton = () => { | |
| 3 | - /* Add a [>>>] button on the top-right corner of code samples to hide | ||
| 3 | + /* Add a [>>>] button in the top-right corner of code samples to hide | ||
| 4 | 4 | * the >>> and ... prompts and the output and thus make the code | |
| 5 | 5 | * copyable. */ | |
| 6 | 6 | const hide_text = 'Hide the prompts and output' | |
@@ -19,6 +19,8 @@ const loadCopyButton = () => { | |||
| 19 | 19 | if (buttonEl.dataset.hidden === 'false') { | |
| 20 | 20 | // hide the code output | |
| 21 | 21 | codeEl.querySelectorAll('.go, .gp, .gt').forEach(el => el.hidden = true) | |
| 22 | + // tracebacks (.gt) contain bare text elements that need to be | ||
| 23 | + // wrapped in a span to hide or show the element | ||
| 22 | 24 | codeEl.querySelectorAll('.gt').forEach(el => { | |
| 23 | 25 | while ((el = el.nextSibling) && el.nodeType !== Node.DOCUMENT_NODE) { | |
| 24 | 26 | if (el.nodeType === Node.ELEMENT_NODE && el.matches(".gp, .go")) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments