mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-04-30 20:12:03 +08:00
clipboard: fix broken style if block code is in table #790
This commit is contained in:
parent
3425f3956a
commit
c557b051f7
@ -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…
x
Reference in New Issue
Block a user