- 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
11 lines
204 B
JavaScript
11 lines
204 B
JavaScript
marked.use({
|
|
async: true,
|
|
breaks: true,
|
|
gfm: true,
|
|
});
|
|
|
|
(
|
|
document.querySelectorAll('.markdown').forEach(async el => {
|
|
el.innerHTML = await marked.parse(el.textContent);
|
|
})
|
|
)() |