File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 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" ) ) {
You can’t perform that action at this time.
0 commit comments