nunomaduro / termwind

🍃 In short, it's like Tailwind CSS, but for the PHP command-line applications.
MIT License
2.29k stars 78 forks source link

Missing after the last line space when inheriting the width on more of more than three lines. #187

Open ycs77 opened 5 months ago

ycs77 commented 5 months ago

Now termwind can inherit width on two lines like:

https://github.com/nunomaduro/termwind/blob/9c030e68f200e039fb91182f407af60727e579fa/tests/render.php#L213-L222

But if add more than three lines, it will be missing after the last line space.

This unit test is failed:

$html = parse(<<<'HTML'
    <div class="w-10">
        <div class="w-full bg-red">AAA</div>
        <div class="w-full bg-blue">BBB</div>
        <div class="w-full bg-yellow">CCC</div>
    </div>
HTML);

// this is expected
expect($html)->toBe("<bg=red>AAA       </>\n<bg=blue>BBB       </>\n<bg=yellow>CCC       </>");

// // this is actual
// expect($html)->toBe("<bg=red>AAA       </>\n<bg=blue>BBB       </>\n<bg=yellow>CCC</>");