-
Notifications
You must be signed in to change notification settings - Fork 819
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
Malformed @click links crash Textual application #4248
Comments
Those aren't broken markup per se. But obviously it shouldn't crash Textual... |
FWIW, my current workaround is: text = self.render_str(value)
# Extra check to work around https://github.com/Textualize/textual/issues/4248:
for span in text.spans:
if hasattr(span.style, 'meta') and span.style.meta.get('@click') == ():
raise MarkupError('problematic @click tag') |
davep
added a commit
to davep/textual
that referenced
this issue
Mar 19, 2024
davep
added a commit
to davep/textual-sandbox
that referenced
this issue
Mar 19, 2024
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
I confirm I can no longer reproduce the issue as of textual 0.54.0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
I was just trying out the
@click
syntax.Expected behaviour
If I create e.g. a Label with incorrect markup, I should get a MarkupError immediately.
Current behaviour
Some
@click
syntax do not raise a MarkupError and make Textual applications crash when clicked, namely:[@click]
[@click=]
[@click=()]
MRE:
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: