Skip to content
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

[BUG] Markdown inside a layout #1234

Closed
polyedre opened this issue May 15, 2021 · 2 comments
Closed

[BUG] Markdown inside a layout #1234

polyedre opened this issue May 15, 2021 · 2 comments

Comments

@polyedre
Copy link
Contributor

Describe the bug

When printing a Markdown object inside a Layout, the rendering only prints the title.

To Reproduce

from rich.markdown import Markdown
from rich.layout import Layout
from rich import print

MARKDOWN = """
description

# Title
"""

layout = Layout(Markdown(MARKDOWN))
print(layout)

Output:

image

Platform

Tested on Linux with xterm and alacritty.

Diagnose

flowery ❯ python -m rich.diagnose
╭───────────────────────── <class 'rich.console.Console'> ─────────────────────────╮
│ A high level console interface.                                                  │
│                                                                                  │
│ ╭──────────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=114 ColorSystem.TRUECOLOR>                                    │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                  │
│     color_system = 'truecolor'                                                   │
│         encoding = 'utf-8'                                                       │
│             file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │
│           height = 64                                                            │
│    is_alt_screen = False                                                         │
│ is_dumb_terminal = False                                                         │
│   is_interactive = True                                                          │
│       is_jupyter = False                                                         │
│      is_terminal = True                                                          │
│   legacy_windows = False                                                         │
│         no_color = False                                                         │
│          options = ConsoleOptions(                                               │
│                        size=ConsoleDimensions(width=114, height=64),             │
│                        legacy_windows=False,                                     │
│                        min_width=1,                                              │
│                        max_width=114,                                            │
│                        is_terminal=True,                                         │
│                        encoding='utf-8',                                         │
│                        justify=None,                                             │
│                        overflow=None,                                            │
│                        no_wrap=False,                                            │
│                        highlight=None,                                           │
│                        markup=None,                                              │
│                        height=None                                               │
│                    )                                                             │
│            quiet = False                                                         │
│           record = False                                                         │
│         safe_box = True                                                          │
│             size = ConsoleDimensions(width=114, height=64)                       │
│        soft_wrap = False                                                         │
│           stderr = False                                                         │
│            style = None                                                          │
│         tab_size = 8                                                             │
│            width = 114                                                           │
╰──────────────────────────────────────────────────────────────────────────────────╯
flowery ❯ python -m rich._windows
platform="Linux"
WindowsConsoleFeatures(vt=False, truecolor=False)
flowery ❯ pip freeze | grep rich
rich==10.1.0
@willmcgugan
Copy link
Collaborator

Please try v10.2.1

@polyedre
Copy link
Contributor Author

I confirm that your PR fixed this 🙂 This was such a chirurgical PR! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants