forum : extrait « À la une » sans la syntaxe Markdown

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cette révision appartient à :
Théo GastineletClaude Opus 5.5 a révisé 2026-11-06 23:05:31 +01:00
1 Parent f673b752b3
révision fad618b22e
2 fichiers modifiés
+2 -2

Aucun fichier ne correspond à votre recherche

+1 -1
Voir le fichier
@@ -369,7 +369,7 @@ class Forum:
def a_la_une(self): def a_la_une(self):
"""Dernier bulletin visible par un visiteur et nombre de nouveaux sujets publics sur sept jours.""" """Dernier bulletin visible par un visiteur et nombre de nouveaux sujets publics sur sept jours."""
bulletin = self.con.execute( 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" " 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" " WHERE t.fixed=1 AND t.status='publie' AND t.hidden=0 AND p.hidden=0"
" ORDER BY p.id DESC LIMIT 1" " ORDER BY p.id DESC LIMIT 1"
+1 -1
Voir le fichier
@@ -1796,7 +1796,7 @@ class Handler(BaseHTTPRequestHandler):
bulletin, n = self.app.forum.a_la_une() bulletin, n = self.app.forum.a_la_une()
donnees = {"n": n} donnees = {"n": n}
if bulletin: if bulletin:
extrait = " ".join(bulletin["corps"].split()) extrait = " ".join(texte_brut(bulletin["corps"], bulletin["format"] or "texte").split())
if len(extrait) > 180: if len(extrait) > 180:
extrait = extrait[:179].rstrip() + "…" extrait = extrait[:179].rstrip() + "…"
donnees.update(titre=bulletin["titre"], auteur=bulletin["auteur"], extrait=extrait, donnees.update(titre=bulletin["titre"], auteur=bulletin["auteur"], extrait=extrait,