mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
fix(code block titles): fixed multiple titles added to a block
This commit is contained in:
parent
6c096bf924
commit
29fa0bea1d
@ -4,6 +4,7 @@ function addTitleToCodeBlocks() {
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
if (els[i].title.length) {
|
||||
let div = document.createElement("div");
|
||||
if (els[i].getElementsByClassName("code-title").length) continue;
|
||||
div.textContent=els[i].title;
|
||||
div.classList.add("code-title")
|
||||
els[i].insertBefore(div, els[i].firstChild);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user