Browse Source

remove extra-rules

main
ghost 8 months ago
parent
commit
fc8ccf10ab
  1. 24
      src/server.php

24
src/server.php

@ -554,33 +554,19 @@ $server->setHandler(
); );
// Value // Value
$lines = [];
foreach ((array) explode(PHP_EOL, (string) $record['value']) as $line)
{
$lines[] = preg_replace(
[
'/(^|\s+)(#|\*|```|=>)/', // escape gemini text
],
[
'$1 $2',
],
$line
);
}
$result[] = null; $result[] = null;
$result[] = trim( $result[] = trim(
preg_replace( preg_replace(
[ [
'/[\n\r]{3,}/', // remove extra breaks '/(^|\s+)(#|\*|```|=>)/', // escape gemini text
'/[\n\r]{3,}/', // remove extra breaks
], ],
[ [
'$1 $2',
PHP_EOL . PHP_EOL, PHP_EOL . PHP_EOL,
], ],
implode( trim(
PHP_EOL, $record['value']
$lines
) )
) )
); );

Loading…
Cancel
Save