refactor: convert markdown parsing to IIFE and preserve indentation

This commit is contained in:
2025-11-18 11:34:37 +01:00
parent bc732d311c
commit e66c46767e
2 changed files with 6 additions and 6 deletions

View File

@@ -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, " "));
}
})();