Skip to content

Inlining Text at the end of Markdown #3657

@BrianPugh

Description

@BrianPugh

Is there any way to concatenate a Text object to a Markdown object such that they are in-line? Basically, if I have code like:

from rich.console import Console
from rich.markdown import Markdown
from rich.text import Text

console = Console()
md = Markdown("**Bold markdown text**")
styled_text = Text(" - followed by styled text", style="bold green")
console.print(md, styled_text)

This code results in (but with color/bold):

Bold markdown text
 - followed by styled text

while my desired output is:

Bold markdown text - followed by styled text

Is there any way to achieve this? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions