From 7a0ffdff5277202f8cd0c36f1fe1f79ca76fab5e Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 9 Nov 2024 11:01:38 -0500 Subject: [PATCH] fix(post): proper headings --- scripts/post.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/post.js b/scripts/post.js index 9f5aa75..6bdf3a1 100644 --- a/scripts/post.js +++ b/scripts/post.js @@ -27,6 +27,9 @@ const makeFold = (h, i) => { }); const mdHeading = document.createElement("span"); + console.log( + `header ${h.tagName} getting prefix ${tagToHeader.get(h.tagName)}, ${h.textContent}`, + ); const header = tagToHeader.has(h.tagName) ? tagToHeader.get(h.tagName) : ""; mdHeading.textContent = `${header} `; mdHeading.style.color = getTopicColor(urlToTopic()); @@ -38,12 +41,14 @@ const makeFold = (h, i) => { document.addEventListener("DOMContentLoaded", () => { document.querySelectorAll("article h2").forEach((h2) => { const mdHeading = document.createElement("span"); - mdHeading.textContent = "# "; mdHeading.style.fontStyle = "normal"; mdHeading.style.color = getTopicColor(urlToTopic()); h2.prepend(mdHeading); }); - document.querySelectorAll(".fold h2").forEach(makeFold); + document.querySelectorAll(".fold h2").forEach((x) => { + console.log("making h2 fold"); + makeFold(x); + }); document.querySelectorAll(".fold h3").forEach(makeFold); });