mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
✨ Feat: add param to hide single code block header (#462)
This commit is contained in:
@@ -381,8 +381,12 @@ class FixIt {
|
||||
$preChroma.parentElement.replaceChild($chroma, $preChroma);
|
||||
$td.appendChild($preChroma);
|
||||
});
|
||||
// render code header
|
||||
this.util.forEach(document.querySelectorAll('.highlight > .chroma:not([data-init])'), ($chroma) => {
|
||||
$chroma.dataset.init = 'true';
|
||||
if ($chroma.parentElement.classList.contains('no-header')) {
|
||||
return;
|
||||
}
|
||||
const $codeElements = $chroma.querySelectorAll('pre.chroma > code');
|
||||
if ($codeElements.length) {
|
||||
const $code = $codeElements[$codeElements.length - 1];
|
||||
|
||||
Reference in New Issue
Block a user