Skip to content

Commit

Permalink
Update highlightjs-badge.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NoralK authored Feb 24, 2024
1 parent e581eea commit 7c52925
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/highlightjs-badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function highlightJsBadge(opt) {

var hudText = document.querySelector(options.templateSelector).innerHTML;

var $codes = document.querySelectorAll("pre>code.hljs");
var $codes = document.querySelectorAll("pre:not(.syntax)>code.hljs");
for (var index = 0; index < $codes.length; index++) {
var el = $codes[index];
if (el.parentElement.querySelector(".code-badge"))
Expand Down Expand Up @@ -245,7 +245,7 @@ function highlightJsBadge(opt) {

// select the <code> tag and grab text
//var $code = $origCode.querySelector("pre>code");
var $code = $origCode.querySelector("pre>.badgeCopy");
var $code = $origCode.querySelector("pre:not(.syntax)>.badgeCopy");
var text = $code.textContent || $code.innerText;

if (options.onBeforeCodeCopied)
Expand Down

0 comments on commit 7c52925

Please sign in to comment.