Author: Christoph M. Becker (cmb69)
Date: 2023-01-04T15:45:40+01:00

Commit: 
https://github.com/php/web-php/commit/b7bccc4049ef4b70810fa159796133019674bdf8
Raw diff: 
https://github.com/php/web-php/commit/b7bccc4049ef4b70810fa159796133019674bdf8.diff

Properly handle whitespace in PHP examples

PhD no longer renders NBSPs, but regular spaces instead[1].  To retain
the desired indentation, we set the CSS propery `white-space:pre`.
However, we cannot do that for the `.phpcode` class directly, because
`highlight_string()` emits additional line breaks at the top and the
bottom of the examples, so we use a more specific selector to avoid
this "padding".

[1] <https://github.com/php/phd/commit/87f794bafe22631f9886adb37db0bdf0006da3dd>

Changed paths:
  M  styles/theme-base.css


Diff:

diff --git a/styles/theme-base.css b/styles/theme-base.css
index 0206a82c7..fcd84a53a 100644
--- a/styles/theme-base.css
+++ b/styles/theme-base.css
@@ -1324,6 +1324,10 @@ div.tip p:first-child {
     font-weight: normal;
 }
 
+.phpcode code span span {
+    white-space: pre;
+}
+
 /* }}} */
 
 

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to