From 38a7bb542b9b364b742a033b72cab52c275829be Mon Sep 17 00:00:00 2001 From: discomrade <83621080+discomrade@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:02:52 +0000 Subject: [PATCH] use where appropriate --- core/microhtml.php | 6 +++--- core/util.php | 2 +- ext/bbcode/info.php | 2 +- ext/bbcode/main.php | 2 +- ext/bbcode/style.css | 4 ---- ext/bbcode/test.php | 2 +- ext/bulk_add_csv/info.php | 8 +++----- ext/comment/theme.php | 8 ++++---- ext/cron_uploader/theme.php | 2 +- ext/et_server/main.php | 4 ++-- ext/favorites/theme.php | 8 ++++---- ext/help_pages/style.css | 5 +++-- ext/media/theme.php | 4 ++-- ext/mime/theme.php | 4 ++-- ext/notes/theme.php | 8 ++++---- ext/numeric_score/theme.php | 16 ++++++++-------- ext/private_image/theme.php | 4 ++-- ext/relationships/theme.php | 10 +++++----- ext/tag_categories/theme.php | 4 ++-- ext/trash/theme.php | 2 +- themes/danbooru/style.css | 4 ++++ themes/danbooru2/style.css | 4 ++++ themes/default/style.css | 5 +++++ themes/futaba/style.css | 1 + 24 files changed, 64 insertions(+), 55 deletions(-) diff --git a/core/microhtml.php b/core/microhtml.php index 7dd8662e..10029333 100644 --- a/core/microhtml.php +++ b/core/microhtml.php @@ -8,11 +8,11 @@ use MicroHTML\HTMLElement; use function MicroHTML\{emptyHTML}; use function MicroHTML\A; +use function MicroHTML\CODE; +use function MicroHTML\DIV; use function MicroHTML\FORM; use function MicroHTML\INPUT; -use function MicroHTML\DIV; use function MicroHTML\OPTION; -use function MicroHTML\PRE; use function MicroHTML\P; use function MicroHTML\SELECT; use function MicroHTML\SPAN; @@ -87,7 +87,7 @@ function SHM_COMMAND_EXAMPLE(string $ex, string $desc): HTMLElement { return DIV( ["class" => "command_example"], - PRE($ex), + CODE($ex), P($desc) ); } diff --git a/core/util.php b/core/util.php index a6086f90..f12d19fd 100644 --- a/core/util.php +++ b/core/util.php @@ -708,7 +708,7 @@ function _fatal_error(\Exception $e): void

Message: '.html_escape($message).' '.$q.'

Version: '.$version.' (on '.$phpver.') -

Stack Trace:

'.$e->getTraceAsString().'
+

Stack Trace:

'.$e->getTraceAsString().'
'; diff --git a/ext/bbcode/info.php b/ext/bbcode/info.php index c0b46095..7f04a92f 100644 --- a/ext/bbcode/info.php +++ b/ext/bbcode/info.php @@ -51,7 +51,7 @@ class BBCodeInfo extends ExtensionInfo
  • [ul]Unordered list[/ul]
  • [ol]Ordered list[/ol]
  • [li]List Item[/li] -
  • [code]
    print(\"Hello World!\");
    [/code] +
  • [code]
    print(\"Hello World!\");
    [/code]
  • [spoiler]Voldemort is bad[/spoiler]
  • [quote]
    To be or not to be...
    [/quote]
  • [quote=Shakespeare]
    Shakespeare said:
    ... That is the question
    [/quote] diff --git a/ext/bbcode/main.php b/ext/bbcode/main.php index 8746a050..e8c6941d 100644 --- a/ext/bbcode/main.php +++ b/ext/bbcode/main.php @@ -164,7 +164,7 @@ class BBCode extends FormatterExtension $middle = base64_decode(substr($text, $start + $l1, ($end - $start - $l1))); $ending = substr($text, $end + $l2, (strlen($text) - $end + $l2)); - $text = $beginning . "
    " . $middle . "
    " . $ending; + $text = $beginning . "
    " . $middle . "
    " . $ending; } return $text; } diff --git a/ext/bbcode/style.css b/ext/bbcode/style.css index 525ff5c5..692cdf8d 100644 --- a/ext/bbcode/style.css +++ b/ext/bbcode/style.css @@ -1,7 +1,3 @@ -.bbcode PRE.code { - background: #DEDEDE; - font-size: 0.9rem; -} .bbcode BLOCKQUOTE { border: 1px solid black; padding: 8px; diff --git a/ext/bbcode/test.php b/ext/bbcode/test.php index 79094841..bf668455 100644 --- a/ext/bbcode/test.php +++ b/ext/bbcode/test.php @@ -37,7 +37,7 @@ class BBCodeTest extends ShimmiePHPUnitTestCase public function testCode(): void { $this->assertEquals( - "
    [b]bold[/b]
    ", + "
    [b]bold[/b]
    ", $this->filter("[code][b]bold[/b][/code]") ); } diff --git a/ext/bulk_add_csv/info.php b/ext/bulk_add_csv/info.php index 41634412..ac4cbab6 100644 --- a/ext/bulk_add_csv/info.php +++ b/ext/bulk_add_csv/info.php @@ -16,13 +16,11 @@ class BulkAddCSVInfo extends ExtensionInfo public string $description = "Bulk add server-side posts with metadata from CSV file"; public ?string $documentation = "Adds posts from a CSV with the five following values: -
    \"/path/to/image.jpg\",\"spaced tags\",\"source\",\"rating s/q/e\",\"/path/thumbnail.jpg\"
    - -e.g. -
    \"/tmp/cat.png\",\"shish oekaki\",\"http://shimmie.shishnet.org\",\"s\",\"tmp/custom.jpg\"
    +
    \"/path/to/image.jpg\",\"spaced tags\",\"source\",\"rating s/q/e\",\"/path/thumbnail.jpg\"
    +e.g.
    \"/tmp/cat.png\",\"shish oekaki\",\"http://shimmie.shishnet.org\",\"s\",\"tmp/custom.jpg\"
    Any value but the first may be omitted, but there must be five values per line. -e.g.
    \"/why/not/try/bulk_add.jpg\",\"\",\"\",\"\",\"\"
    +e.g.
    \"/why/not/try/bulk_add.jpg\",\"\",\"\",\"\",\"\"
    Useful for importing tagged posts without having to do database manipulation. diff --git a/ext/comment/theme.php b/ext/comment/theme.php index adf39848..c06d6be1 100644 --- a/ext/comment/theme.php +++ b/ext/comment/theme.php @@ -306,20 +306,20 @@ class CommentListTheme extends Themelet { return '

    Search for posts containing a certain number of comments, or comments by a particular individual.

    -
    comments=1
    + comments=1

    Returns posts with exactly 1 comment.

    -
    comments>0
    + comments>0

    Returns posts with 1 or more comments.

    Can use <, <=, >, >=, or =.

    -
    commented_by:username
    + commented_by:username

    Returns posts that have been commented on by "username".

    -
    commented_by_userno:123
    + commented_by_userno:123

    Returns posts that have been commented on by user 123.

    '; diff --git a/ext/cron_uploader/theme.php b/ext/cron_uploader/theme.php index c5f9a99d..1133f092 100644 --- a/ext/cron_uploader/theme.php +++ b/ext/cron_uploader/theme.php @@ -102,7 +102,7 @@ class CronUploaderTheme extends Themelet
  • You can inherit categories by creating a folder that ends with \";\". For instance category;\\tag1 would result in the tag category:tag1. This allows creating a category folder, then creating many subfolders that will use that category.
  • The cron uploader works by importing files from the queue folder whenever this url is visited: -
    $cron_url
    +
    $cron_url