refactor: convert markdown parsing to IIFE and preserve indentation
This commit is contained in:
parent
bc732d311c
commit
e66c46767e
@ -4,8 +4,8 @@ marked.use({
|
||||
gfm: true,
|
||||
});
|
||||
|
||||
(
|
||||
document.querySelectorAll('.markdown').forEach(async el => {
|
||||
el.innerHTML = await marked.parse(el.textContent);
|
||||
})
|
||||
)()
|
||||
(async () => {
|
||||
for (const el of document.querySelectorAll('.markdown')) {
|
||||
el.innerHTML = await marked.parse(el.textContent.replace(/(\t| )/g, " "));
|
||||
}
|
||||
})();
|
||||
@ -1 +1 @@
|
||||
marked.use({"async":!0,breaks:!0,gfm:!0});document.querySelectorAll(".markdown").forEach(async n=>{n.innerHTML=await marked.parse(n.textContent)})();
|
||||
marked.use({"async":!0,breaks:!0,gfm:!0});(async()=>{for(const n of document.querySelectorAll(".markdown"))n.innerHTML=await marked.parse(n.textContent.replace(/(\t| )/g," "))})();
|
||||
Loading…
x
Reference in New Issue
Block a user