Skip to content

Commit 73a4a4e

Browse files
committed
fix(output.helper): pad ##
1 parent 6ff4acd commit 73a4a4e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Helper/OutputHelper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,10 @@ public function showUsage(string $usage = null): self
211211
}
212212

213213
$lines = \explode("\n", \str_replace(['<eol>', '<eol/>', '</eol>', "\r\n"], "\n", $usage));
214-
foreach ($lines as &$pos) {
215-
$pos = \strpos(\preg_replace('~<.*?>~', '', $pos), ' ##');
214+
foreach ($lines as $i => &$pos) {
215+
if (false === $pos = \strrpos(\preg_replace('~</?\w+/?>~', '', $pos), ' ##')) {
216+
unset($lines[$i]);
217+
}
216218
}
217219

218220
$maxlen = \max($lines) + 4;

0 commit comments

Comments
 (0)