From e02706eef130529aac80bb58cf9755c850e316a7 Mon Sep 17 00:00:00 2001
From: Mischa POSLAWSKY
Date: Tue, 27 Apr 2021 20:37:24 +0200
Subject: [PATCH 1/1] issue/activity: format replies for dashboard
Cut consecutive paragraphs (similar to news feed)
and move images right to take less space.
---
widget/issue/activity.php | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/widget/issue/activity.php b/widget/issue/activity.php
index bb694c7..153034e 100644
--- a/widget/issue/activity.php
+++ b/widget/issue/activity.php
@@ -9,6 +9,12 @@ $sql .= " WHERE message IS NOT NULL";
$sql .= " ORDER BY m.created DESC LIMIT $limit";
$query = $Db->query($sql);
+$msgformat = [
+ "{(?=
\n).+}s" => ' ',
+ '{(.*)(]+>
)\s*}' => "$2\n$1",
+ '{(?<=';
$group = NULL;
@@ -31,7 +37,7 @@ while ($row = $query->fetch()) {
print "";
print '';
print '';
- print $row->message;
+ print preg_replace(array_keys($msgformat), array_values($msgformat), $row->message);
print "\n";
}
--
2.30.0