-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix switch alternative syntax #2648
Conversation
<?php case 1: ?> | ||
... | ||
<?php endswitch ?> | ||
<?php endswitch; ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both styles do work, but having the semicolon is probably better.
@@ -67,9 +67,10 @@ endif; | |||
<programlisting role="php"> | |||
<![CDATA[ | |||
<?php switch ($foo): ?> | |||
|
|||
<?php case 1: ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the actual problem that the rendered version dropped the indentation of this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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