File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -346,10 +346,11 @@ export function initGlobalButtons() {
346
346
347
347
// get raw text for copy content button
348
348
const copyContentButtons = document . querySelectorAll ( 'button.copy-content' ) ;
349
- if ( copyContentButtons . length == 0 ) return ;
350
- const text = Array . from ( document . querySelectorAll ( '.lines-code' ) ) . map ( ( el ) => el . textContent ) . join ( '' ) ;
351
- for ( const copyContentButton of copyContentButtons ) {
352
- copyContentButton . setAttribute ( 'data-clipboard-text' , text ) ;
349
+ if ( copyContentButtons . length !== 0 ) {
350
+ const text = Array . from ( document . querySelectorAll ( '.lines-code' ) ) . map ( ( el ) => el . textContent ) . join ( '' ) ;
351
+ for ( const copyContentButton of copyContentButtons ) {
352
+ copyContentButton . setAttribute ( 'data-clipboard-text' , text ) ;
353
+ }
353
354
}
354
355
}
355
356
You can’t perform that action at this time.
0 commit comments