From b7bccc4049ef4b70810fa159796133019674bdf8 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 4 Jan 2023 15:43:46 +0100 Subject: [PATCH] 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] --- styles/theme-base.css | 4 ++++ 1 file changed, 4 insertions(+) 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; +} + /* }}} */