mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-04-30 22:32:02 +08:00
highlight: to much simplification #169
This commit is contained in:
parent
90db4823dc
commit
73fdfb5ea6
@ -557,11 +557,12 @@ function initCodeClipboard(){
|
||||
code.parentNode.classList.add( 'pre-code' );
|
||||
}
|
||||
else{
|
||||
var parent = code.parentNode;
|
||||
var clone = code.cloneNode( true );
|
||||
var span = document.createElement( 'span' );
|
||||
span.classList.add( 'copy-to-clipboard' );
|
||||
span.appendChild( code );
|
||||
parent.appendChild( span );
|
||||
span.appendChild( clone );
|
||||
code.parentNode.replaceChild( span, code );
|
||||
code = clone;
|
||||
}
|
||||
var button = document.createElement( 'span' );
|
||||
button.classList.add( 'copy-to-clipboard-button' );
|
||||
|
Loading…
x
Reference in New Issue
Block a user