From d776e2cb167512cb19905a39b5023e1726bc57e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 29 Aug 2023 19:15:35 +0200 Subject: [PATCH 1/3] Use `white-space: pre-wrap` for code formatting Apparently code formatting is used for the entire user comments. Use `white-space: pre-wrap` to avoid horizontal scrolling of the plaintext description. see 7d4038829e601bfdff3c434f5d8f20d84b344e27 --- styles/theme-base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/theme-base.css b/styles/theme-base.css index 69866024a2..2485eced9f 100644 --- a/styles/theme-base.css +++ b/styles/theme-base.css @@ -1328,7 +1328,7 @@ div.tip p:first-child { .docs .phpcode code { display: block; overflow-x: auto; - white-space: pre; + white-space: pre-wrap; } .docs .qandaentry dt .phpcode * { From d887006a8ce056a9b57a0f56bc5cf95425ef0126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 30 Aug 2023 18:59:28 +0200 Subject: [PATCH 2/3] Unify `highlight_php()` with PhD see php/phd@01d6beb366bfb5e5b99bfdcc44393d8d1ee2d433 --- include/layout.inc | 24 ++++++------------------ styles/theme-base.css | 2 +- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/include/layout.inc b/include/layout.inc index 14d6d3607d..7378d66ec1 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -20,26 +20,14 @@ function highlight_php($code, $return = false) } // Fix output to use CSS classes and wrap well - $highlighted = '
' . str_replace( + $highlighted = '
' . strtr( + $highlighted, [ - ' ', - '
', - '\n", - ' ' ', + "\n" => '', + + ''; if ($return) { return $highlighted; } diff --git a/styles/theme-base.css b/styles/theme-base.css index 2485eced9f..01164945cb 100644 --- a/styles/theme-base.css +++ b/styles/theme-base.css @@ -1325,7 +1325,7 @@ div.tip p:first-child { margin-bottom: 1.5rem; } -.docs .phpcode code { +.phpcode code { display: block; overflow-x: auto; white-space: pre-wrap; From 366a34de7eb1fdaec6a73b5db0786ac1f83cb1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 30 Aug 2023 19:04:11 +0200 Subject: [PATCH 3/3] Fix markup for notes in add-note.php --- manual/add-note.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/manual/add-note.php b/manual/add-note.php index 72d931bfac..e05a191da3 100644 --- a/manual/add-note.php +++ b/manual/add-note.php @@ -190,11 +190,7 @@
- - -

eval() is the best for all sorts of things

-
-
+ eval() is the best for all sorts of things
@@ -220,11 +216,7 @@
- - -

If eval() is the answer, you're almost certainly asking the wrong question.

-
-
+ If eval() is the answer, you're almost certainly asking the wrong question.
@@ -250,11 +242,7 @@
- - -

egg bacon sausage spam spam baked beans

-
-
+ egg bacon sausage spam spam baked beans