[DOC-WEB] [web-doc] master: Add styling, overflow for `<pre>` blocks (closes #46) (#61)
[email protected] (Jim Winstead via GitHub) Tue, 26 Nov 2024 22:20:12 +0000
| Newsgroups | php.doc.web |
|---|---|
| Message-ID | <[email protected]> |
Author: Jim Winstead (jimwins)
Committer: GitHub (web-flow)
Pusher: jimwins
Date: 2024-11-26T14:15:39-08:00
Commit: https://github.com/php/web-doc/commit/d2cbba473533ba9ed6929d8560f11d78b2ae09fd
Raw diff: https://github.com/php/web-doc/commit/d2cbba473533ba9ed6929d8560f11d78b2ae09fd.diff
Add styling, overflow for `<pre>` blocks (closes #46) (#61)
Changed paths:
M include/lib_general.inc.php
M include/lib_revcheck.inc.php
Diff:
diff --git a/include/lib_general.inc.php b/include/lib_general.inc.php
index 31fa8b5..1b7ced9 100644
--- a/include/lib_general.inc.php
+++ b/include/lib_general.inc.php
@@ -52,6 +52,13 @@ function site_header()
.copy { margin:0; padding: 0; font-size:small; }
.copy:hover { text-transform: uppercase; }
.copy:active { background: aqua; font-weight: bold; }
+pre {
+ background: white;
+ border: solid 1px rgb(214, 214, 214);
+ padding: 0.75rem;
+ overflow: auto;
+ font: normal 0.875rem/1.5rem "Source Code Pro", monospace;
+}
</style>
END_OF_MULTILINE;
echo '<section class="mainscreen">';
diff --git a/include/lib_revcheck.inc.php b/include/lib_revcheck.inc.php
index 882452b..2bb5843 100644
--- a/include/lib_revcheck.inc.php
+++ b/include/lib_revcheck.inc.php
@@ -249,7 +249,8 @@ function showdiff ()
chdir( GIT_DIR . 'en' );
$arg_h = escapeshellarg($h);
$arg_f = escapeshellarg($gitfile);
- $file = `git -c {$safedir} diff --ignore-space-at-eol {$arg_h} -- {$arg_f}`;
+ echo "git -c {$safedir} diff -b --word-diff=porcelain {$arg_h} -- {$arg_f}";
+ $file = `git -c {$safedir} diff -b --word-diff=porcelain {$arg_h} -- {$arg_f}`;
if ($file == null)
$file = `git -c {$safedir} diff {$arg_h} -- {$arg_f}`;
$hash = `git -c {$safedir} log -n 1 --pretty=format:%H -- {$arg_f}`;