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
[Console] SymfonyStyle: fix block rpadding when escaping '<' #14600
Conversation
ogizanagi
commented
May 10, 2015
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | - |
License | MIT |
Doc PR | - |
The result looks good. Though I don't understand why this is necessary. @ogizanagi Did you find the cause for this issue? |
@xabbuh : AFAIU, it's only due to extra backslashes introduced by the
|
@ogizanagi Indeed, that makes sense. 👍 |
👍 |
@@ -85,7 +85,7 @@ public function block($messages, $type = null, $style = null, $prefix = ' ', $pa | |||
|
|||
foreach ($lines as &$line) { | |||
$line = sprintf('%s%s', $prefix, $line); | |||
$line .= str_repeat(' ', $this->lineLength - Helper::strlen($line)); | |||
$line .= str_repeat(' ', $this->lineLength - Helper::strlen($line) + substr_count($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.
would you mind add a comment above that explain the change :) ?
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.
Should I link this PR as reference in a comment ? comment + link or just link ?
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.
https://github.com/symfony/symfony/pull/14600/files#diff-18b76c26b226bea37b2b821a5e4962ffR88
Let me know what comment you expect if you think it's better :)
Thank you @ogizanagi. |
…<' (ogizanagi) This PR was merged into the 2.7 branch. Discussion ---------- [Console] SymfonyStyle: fix block rpadding when escaping '<' | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - ![screenshot 2015-05-10 a 20 37 46](https://cloud.githubusercontent.com/assets/2211145/7555745/4dfbfd58-f755-11e4-98c4-3c42bb71abd3.PNG) Commits ------- 80fc341 [Console] SymfonyStyle: fix block rpadding when escaping '<'