mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
📝 Docs(ignore): rename function initHighlight to initCodeWrapper
This commit is contained in:
+18
-4
@@ -362,8 +362,12 @@ class FixIt {
|
||||
}
|
||||
}
|
||||
|
||||
initHighlight() {
|
||||
/**
|
||||
* init code wrapper
|
||||
*/
|
||||
initCodeWrapper() {
|
||||
if (!this.config.code) {
|
||||
this.initCopyCode();
|
||||
return
|
||||
}
|
||||
// if markup.highlight.lineNumbersInTable set to false
|
||||
@@ -385,6 +389,7 @@ class FixIt {
|
||||
this.util.forEach(document.querySelectorAll('.highlight > .chroma:not([data-init])'), ($chroma) => {
|
||||
$chroma.dataset.init = 'true';
|
||||
if ($chroma.parentElement.classList.contains('no-header')) {
|
||||
this.initCopyCode($chroma);
|
||||
return;
|
||||
}
|
||||
const $codeElements = $chroma.querySelectorAll('pre.chroma > code');
|
||||
@@ -481,6 +486,15 @@ class FixIt {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* init simple copy code when there is no code header
|
||||
* https://github.com/github/clipboard-copy-element
|
||||
* @param {ELement} singleCode single code block
|
||||
*/
|
||||
initCopyCode(singleCode) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
/**
|
||||
* init table of contents
|
||||
*/
|
||||
@@ -976,7 +990,7 @@ class FixIt {
|
||||
this.initTwemoji();
|
||||
this.initDetails();
|
||||
this.initLightGallery();
|
||||
this.initHighlight();
|
||||
this.initCodeWrapper();
|
||||
this.initTable();
|
||||
this.initMath();
|
||||
this.initMermaid();
|
||||
@@ -994,7 +1008,7 @@ class FixIt {
|
||||
this.initTwemoji($content);
|
||||
this.initDetails($content);
|
||||
this.initLightGallery();
|
||||
this.initHighlight();
|
||||
this.initCodeWrapper();
|
||||
this.initTable($content);
|
||||
this.initMath($content);
|
||||
this.initMermaid();
|
||||
@@ -1215,7 +1229,7 @@ class FixIt {
|
||||
this.initTwemoji();
|
||||
this.initDetails();
|
||||
this.initLightGallery();
|
||||
this.initHighlight();
|
||||
this.initCodeWrapper();
|
||||
this.initTable();
|
||||
this.initMath();
|
||||
this.initMermaid();
|
||||
|
||||
Reference in New Issue
Block a user