mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
clipboard: fix broken style if block code is in table #790
This commit is contained in:
parent
3425f3956a
commit
c557b051f7
1 changed files with 2 additions and 1 deletions
|
@ -594,7 +594,8 @@ function initCodeClipboard(){
|
||||||
var text = getCodeText( code );
|
var text = getCodeText( code );
|
||||||
var inPre = code.parentNode.tagName.toLowerCase() == 'pre';
|
var inPre = code.parentNode.tagName.toLowerCase() == 'pre';
|
||||||
var inTable = inPre &&
|
var inTable = inPre &&
|
||||||
code.parentNode.parentNode.tagName.toLowerCase() == 'td';
|
code.parentNode.parentNode.tagName.toLowerCase() == 'td' &&
|
||||||
|
code.parentNode.parentNode.classList.contains('lntd');
|
||||||
// avoid copy-to-clipboard for highlight shortcode in table lineno mode
|
// avoid copy-to-clipboard for highlight shortcode in table lineno mode
|
||||||
var isFirstLineCell = inTable &&
|
var isFirstLineCell = inTable &&
|
||||||
code.parentNode.parentNode.parentNode.querySelector( 'td:first-child > pre > code' ) == code;
|
code.parentNode.parentNode.parentNode.querySelector( 'td:first-child > pre > code' ) == code;
|
||||||
|
|
Loading…
Reference in a new issue