From 624b21554ce9e51a535d30dd72efad6db801bb0c Mon Sep 17 00:00:00 2001 From: ewen Date: Sat, 16 May 2026 21:12:42 +0200 Subject: [PATCH] =?UTF-8?q?changement=20du=20fonctionnement=20des=20dep?= =?UTF-8?q?=C3=AAches,=20retours=20a=20la=20ligne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/assets/main.js b/assets/main.js index 7bbceaa..045004f 100644 --- a/assets/main.js +++ b/assets/main.js @@ -93,11 +93,21 @@ function chargerAlbums() { async function chargerDepeches() { const feed = document.getElementById('feed'); + function escapeHtml(str) { + return str + .replace(/&/g, '&') + .replace(//g, '>'); + } + async function parseTexte(texte) { const urlRegex = /(https?:\/\/[^\s]+)/g; const urls = texte.match(urlRegex) || []; let html = texte.replace(urlRegex, '___URL___'); + // échappe le HTML et convertit les retours à la ligne + html = escapeHtml(html).replace(/\n/g, '
'); + const embeds = await Promise.all(urls.map(async url => { if (url.includes('soundcloud.com')) { try {