File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ function initialize() {
68
68
// Trigger copy failure state lifecycle
69
69
70
70
$ ( '.copy-code' ) . click ( function ( ) {
71
- let text = $ ( this ) . closest ( '.code-controls' ) . prev ( 'pre' ) [ 0 ] . innerText ;
71
+ let text = $ ( this ) . closest ( '.code-controls' ) . prevAll ( 'pre:has(code) ' ) [ 0 ] . innerText ;
72
72
73
73
const copyContent = async ( ) => {
74
74
try {
@@ -90,7 +90,7 @@ Disable scrolling on the body.
90
90
Disable user selection on everything but the fullscreen codeblock.
91
91
*/
92
92
$ ( '.fullscreen-toggle' ) . click ( function ( ) {
93
- var code = $ ( this ) . closest ( '.code-controls' ) . prev ( 'pre' ) . clone ( ) ;
93
+ var code = $ ( this ) . closest ( '.code-controls' ) . prevAll ( 'pre:has(code) ' ) . clone ( ) ;
94
94
95
95
$ ( '#fullscreen-code-placeholder' ) . replaceWith ( code [ 0 ] ) ;
96
96
$ ( 'body' ) . css ( 'overflow' , 'hidden' ) ;
You can’t perform that action at this time.
0 commit comments