From 80aaa7687d2b473829f46925c239cb30f1a9995f Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 27 Feb 2024 13:11:32 +0200 Subject: [PATCH] apply code escape on transaction page --- src/server.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/server.php b/src/server.php index d32a66e..563f5d5 100644 --- a/src/server.php +++ b/src/server.php @@ -427,7 +427,22 @@ $server->setHandler( $config->geminiapp->string->value ); - $result[] = $record['value']; + $lines = []; + + foreach ((array) explode(PHP_EOL, (string) $record['value']) as $line) + { + $lines[] = preg_replace( + '/^```/', + ' ```', + $line + ); + } + + $result[] = implode( + PHP_EOL, + $lines + ); + $result[] = '```'; $result[] = sprintf(