// Utilizzata la libreria marked per trasformare markdown in html async function showfile(filename, target) { const bottoni = document.querySelectorAll('.btn-appunto'); bottoni.forEach(b => b.classList.remove('active')); if(target) target.classList.add('active'); const container = document.getElementById('markdown-content'); container.innerHTML = "
Caricamento in corso...
"; try { const response = await fetch(filename); if (!response.ok) throw new Error("File non trovato"); const markdownRaw = await response.text(); container.innerHTML = marked.parse(markdownRaw); } catch (error) { container.innerHTML = "Errore nel caricamento dell'appunto.
"; } }