Skip to content

[BUG] Nested color tags not working if adjoint #1334

@tkmikan

Description

@tkmikan

Describe the bug
For nested bbcode tags, if two open tags of colors are adjoint, the latter one does not work.

To Reproduce

from rich.console import Console
console = Console()
print(list(console.render('[red][blue]this should be blue[/blue]red here[/red]')))

Expection: [Segment('this should be blue', Style.parse("blue")), Segment('red here', Style.parse("red")), Segment('\n', None)]
Actual: [Segment('this should be blue', Style.parse("red")), Segment('red here', Style.parse("red")), Segment('\n', None)]

Things work if a space is inserted between the open tags, or if either tag is not a color tag,

Platform
Platform: Linux and Mac
I belive it is not a platform specific issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions