forum : extrait « À la une » sans la syntaxe Markdown
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cette révision appartient à :
1 Parent
f673b752b3
révision
fad618b22e
2 fichiers modifiés
+2
-2
Aucun fichier ne correspond à votre recherche
@@ -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"
|
||||
|
||||
@@ -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,
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur