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,