Skip to content

Commit

Permalink
Fix Padding in ListItemRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanzweifel committed Nov 21, 2023
1 parent 463f101 commit 9db3169
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Renderer/Block/ListItemRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ private function addBulletChar(ListData $listData, string $content): string
{
switch ($listData->type) {
case ListBlock::TYPE_BULLET:
$padding = str_repeat(' ', $listData->padding - 1);
// Subtract 1 character from $listData->padding if the value is greater than 0.
// The one character represents the bullet character.
$padding = $listData->padding > 0 ? $listData->padding - 1 : 1;
$padding = str_repeat(' ', $padding);
return "{$listData->bulletChar}{$padding}{$content}";
case ListBlock::TYPE_ORDERED:
switch ($listData->delimiter) {
Expand Down

0 comments on commit 9db3169

Please sign in to comment.