From 617a91735ef51618292f8bf8b66644e422360f52 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 4 Mar 2024 18:20:00 +0200 Subject: [PATCH] show keys only in records list --- src/server.php | 43 +++++++------------------------------------ 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/src/server.php b/src/server.php index b30ef55..26f4bb1 100644 --- a/src/server.php +++ b/src/server.php @@ -273,10 +273,14 @@ $server->setHandler( // Append latest records foreach ($records as $record) { - // Key - $result[] = null; + // Link $result[] = sprintf( - '### %s', + '=> /%s %s %s', + $record['transaction'], + date( + 'Y-m-d', + $record['time'] + ), trim( preg_replace( // single-line '/[\s]+/', @@ -285,43 +289,10 @@ $server->setHandler( ) ) ); - - // Value - $result[] = null; - $result[] = trim( - preg_replace( - [ - '/(^|\s+)(#|\*|```|=>)/', // escape gemini text - '/[\n\r]{3,}/', // remove extra breaks - ], - [ - '$1 $2', - PHP_EOL . PHP_EOL, - ], - $record['value'] - ) - ); - - // Link - $result[] = null; - $result[] = sprintf( - '=> /%s %s in %d', - $record['transaction'], - date( - 'Y-m-d', - $record['time'] - ), - $record['block'] - ); } // Append navigation $result[] = null; - $result[] = sprintf( - '## %s', - $config->geminiapp->string->navigation - ); - $result[] = null; // Pagination $older = [];