1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

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] <87f794bafe>
This commit is contained in:
Christoph M. Becker
2023-01-04 15:43:46 +01:00
parent fa9eb3d840
commit b7bccc4049

View File

@@ -1324,6 +1324,10 @@ div.tip p:first-child {
font-weight: normal;
}
.phpcode code span span {
white-space: pre;
}
/* }}} */