Conversation
| <?php case 1: ?> | ||
| ... | ||
| <?php endswitch ?> | ||
| <?php endswitch; ?> |
There was a problem hiding this comment.
Both styles do work, but having the semicolon is probably better.
| <![CDATA[ | ||
| <?php switch ($foo): ?> | ||
|
|
||
| <?php case 1: ?> |
There was a problem hiding this comment.
Isn't the actual problem that the rendered version dropped the indentation of this line?
There was a problem hiding this comment.
Maybe... that's something that should be flagged on PhD (and the joy of having no tests for it to catch regressions...) hopefully the new line break will "fix" this anyway
There was a problem hiding this comment.
It was a CSS issue, no white-space: pre. I also found the previous version a more "natural" mistake, because it can easily halten that someone wants to indent the next line, whereas adding an empty line is less likely.
There was a problem hiding this comment.
Right, if it's fixed then please feel free to revert.
* Drop `\n` when highlighting Actual newlines will be replaced by `<br />` during highlighting and the `\n` in the boilerplate conflicts with `white-space: pre;`. see php/doc-en#2648 * Simplify character replacement for `highlight_string` result
This is needed to correctly handle whitespace outside of a `<?php … ?>` portion. see b7bccc4 see php/phd@01d6beb see php/doc-en#2648
As per the discussion in php#2648, the part that might actually be unexpected is that leading indentation also causes problems. The addition of the empty line distracts from that. Now that the CSS for PHP.net is fixed, this can be reverted. This reverts commit 1d73d6e. see php/web-php#801
As per the discussion in #2648, the part that might actually be unexpected is that leading indentation also causes problems. The addition of the empty line distracts from that. Now that the CSS for PHP.net is fixed, this can be reverted. This reverts commit 1d73d6e. see php/web-php#801
Fix #2635