-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Describe the bug
When rendering a multiline Text made up of only spaces, Rich fails to measure its width. It seems that Rich will use the sum of each line's width rather than the maximum of them.
To Reproduce
from rich import print
from rich.panel import Panel
from rich.text import Text
print(Panel.fit(Text(' \n \n ', style = 'on green'), padding = 0))
Instead of rendering a panel of width 3, it turns out 6. As long as the Text contains non-whitespace characters, this phenomenon disappears.
Platform
I tried it on both windows 7/10 cmd and default terminal in linux, and encountered the same problem.
Reactions are currently unavailable