Skip to content

Commit

Permalink
♿ Feat: avoid using :has to be compatible with older browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Jun 6, 2024
1 parent cbde3f0 commit b4940f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ class FixIt {
$preChroma.parentElement.replaceChild($chroma, $preChroma);
$td.appendChild($preChroma);
});
this.util.forEach(document.querySelectorAll('.highlight > .chroma:not(:has(.code-header))'), ($chroma) => {
this.util.forEach(document.querySelectorAll('.highlight > .chroma:not([data-init])'), ($chroma) => {
$chroma.dataset.init = 'true';
const $codeElements = $chroma.querySelectorAll('pre.chroma > code');
if ($codeElements.length) {
const $code = $codeElements[$codeElements.length - 1];
Expand Down

0 comments on commit b4940f4

Please sign in to comment.