mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
highlight: to much simplification #169
This commit is contained in:
parent
90db4823dc
commit
73fdfb5ea6
1 changed files with 4 additions and 3 deletions
|
@ -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…
Reference in a new issue