feat: final refactor for port
This commit is contained in:
parent
cd9bd06eef
commit
c08e4ce9d5
4 changed files with 131 additions and 140 deletions
18
public/scripts/centerKatek.js
Normal file
18
public/scripts/centerKatek.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const katexParagraphs = document.querySelectorAll("article p");
|
||||
|
||||
katexParagraphs.forEach((p) => {
|
||||
const katexSpan = p.querySelector(".katex");
|
||||
if (!katexSpan) return;
|
||||
|
||||
const clone = p.cloneNode(true);
|
||||
clone.querySelector(".katex").remove();
|
||||
const textWithoutKatex = clone.textContent.trim();
|
||||
|
||||
if (textWithoutKatex === "") {
|
||||
p.style.display = "flex";
|
||||
p.style.justifyContent = "center";
|
||||
p.style.margin = "1.5rem 0";
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue