Skip to content

Content.from_rich_text(): conceal and overline styles are recognized but not rendered #5787

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

Open
2 tasks done
xavierog opened this issue May 4, 2025 · 1 comment
Open
2 tasks done

Comments

@xavierog
Copy link
Contributor

xavierog commented May 4, 2025

The bug

Content.from_rich_text() recognizes conceal and overline (i.e. no MissingStyle exception), but these styles are not rendered.

Note: I did ensure my terminal was able to render these styles using:

  • echo -e '\x1b[53moverline\x1b[0m\x1b[21mdoubly-underlined'
  • rich --print '[overline]overline[/][underline2]doubly-underlined[/]'

MRE

#!/usr/bin/env python3
from textual.app import App, ComposeResult
from textual.content import Content
from textual.widgets import Label

STYLES = ("bold", "conceal", "italic", "overline", "reverse", "strike", "underline", "underline2")

class ConcealOverline(App):
	def compose(self) -> ComposeResult:
		yield Label("conceal and overline no longer work:")
		rich_markup = " ".join(f"[{style}]{style}[/]" for style in STYLES)
		content = Content.from_rich_text(rich_markup)
		yield Label(content)

if __name__ == "__main__":
	app = ConcealOverline()
	app.run()

Image

Textual Diagnostics

Versions

Name Value
Textual 3.2.0
Rich 14.0.0

Python

Name Value
Version 3.13.3
Implementation CPython
Compiler GCC 14.2.0
Executable /path/to/my/venv/bin/python3

Operating System

Name Value
System Linux
Release 6.12.25-amd64
Version #1 SMP PREEMPT_DYNAMIC Debian 6.12.25-1 (2025-04-25)

Terminal

Name Value
Terminal Application Unknown
TERM xterm-256color
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=284, height=77
legacy_windows False
min_width 1
max_width 284
is_terminal False
encoding utf-8
max_height 77
justify None
overflow None
no_wrap False
highlight None
markup None
height None
Copy link

github-actions bot commented May 4, 2025

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

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

No branches or pull requests

1 participant