From fad618b22edf985c0f95d84309e3086d82d0fd07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Gastinel?= <264859180+gastinelt@users.noreply.github.com> Date: Fri, 6 Nov 2026 23:05:31 +0100 Subject: [PATCH] =?UTF-8?q?forum=20:=20extrait=20=C2=AB=20=C3=80=20la=20un?= =?UTF-8?q?e=20=C2=BB=20sans=20la=20syntaxe=20Markdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- forum/forum.py | 2 +- forum/server.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/forum/forum.py b/forum/forum.py index 780fdc6..ca28a9a 100644 --- a/forum/forum.py +++ b/forum/forum.py @@ -369,7 +369,7 @@ class Forum: def a_la_une(self): """Dernier bulletin visible par un visiteur et nombre de nouveaux sujets publics sur sept jours.""" bulletin = self.con.execute( - "SELECT t.id AS sujet, t.title AS titre, p.body AS corps, " + nom_sql() + " AS auteur" + "SELECT t.id AS sujet, t.title AS titre, p.body AS corps, p.format AS format, " + nom_sql() + " AS auteur" " FROM topics t JOIN posts p ON p.topic_id=t.id JOIN users u ON u.id=p.author_id" " WHERE t.fixed=1 AND t.status='publie' AND t.hidden=0 AND p.hidden=0" " ORDER BY p.id DESC LIMIT 1" diff --git a/forum/server.py b/forum/server.py index ef35c9f..f444ac9 100644 --- a/forum/server.py +++ b/forum/server.py @@ -1796,7 +1796,7 @@ class Handler(BaseHTTPRequestHandler): bulletin, n = self.app.forum.a_la_une() donnees = {"n": n} if bulletin: - extrait = " ".join(bulletin["corps"].split()) + extrait = " ".join(texte_brut(bulletin["corps"], bulletin["format"] or "texte").split()) if len(extrait) > 180: extrait = extrait[:179].rstrip() + "…" donnees.update(titre=bulletin["titre"], auteur=bulletin["auteur"], extrait=extrait,