feat: enable async marked parsing and improve markdown rendering
- Configure marked with async, breaks, and GFM options - Update markdown processing to use textContent and async marked.parse - Replace synchronous innerHTML parsing with awaited async parsing
This commit is contained in:
parent
c90d29d654
commit
bc732d311c
@ -1 +1,11 @@
|
||||
document.querySelectorAll('.markdown').forEach(e => e.innerHTML = marked.parse(e.innerHTML));
|
||||
marked.use({
|
||||
async: true,
|
||||
breaks: true,
|
||||
gfm: true,
|
||||
});
|
||||
|
||||
(
|
||||
document.querySelectorAll('.markdown').forEach(async el => {
|
||||
el.innerHTML = await marked.parse(el.textContent);
|
||||
})
|
||||
)()
|
||||
@ -1 +1 @@
|
||||
document.querySelectorAll(".markdown").forEach(n=>n.innerHTML=marked.parse(n.innerHTML));
|
||||
marked.use({"async":!0,breaks:!0,gfm:!0});document.querySelectorAll(".markdown").forEach(async n=>{n.innerHTML=await marked.parse(n.textContent)})();
|
||||
Loading…
x
Reference in New Issue
Block a user