1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Code style: Add more checks

This commit is contained in:
Jakub Vrana
2025-03-05 16:32:51 +01:00
parent 873d6d50fd
commit d9df9693e3
4 changed files with 31 additions and 9 deletions

View File

@@ -98,8 +98,9 @@ function pre_tr($s) {
}
$table = '(\+--[-+]+\+\n)';
$row = '(\| .* \|\n)';
echo
preg_replace_callback("~^$table?$row$table?($row*)$table?~m", function ($match) {
echo preg_replace_callback(
"~^$table?$row$table?($row*)$table?~m",
function ($match) {
$first_row = pre_tr($match[2]);
return "<table>\n" . ($match[1] ? "<thead>$first_row</thead>\n" : $first_row) . pre_tr($match[4]) . "\n</table>";
},
@@ -107,6 +108,7 @@ echo
'~(\n( -|mysql)&gt; )(.+)~',
"\\1<code class='jush-sql'>\\3</code>",
preg_replace('~(.+)\n---+\n~', "<b>\\1</b>\n", h($routine['comment']))
));
)
);
?>
</pre>