-
Notifications
You must be signed in to change notification settings - Fork 815
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
Certain renderables created with rich.markdown generate AssertionError when rendered in a Widget #3006
Comments
We found the following entries in the FAQ which you may find helpful:
Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review. This is an automated reply, generated by FAQtory |
Including the traceback or at least the error message can be very helpful… |
The traceback was huge and not particularly useful to be fair. If you run this just with Rich however: Example codefrom rich.console import Console
from rich.markdown import Markdown
# This will work
responses = "| Simple | Table |\n| ------ | ----- |\n| cell1 | cell2 |"
# This will not work
responses = "| Simple | Table |\n| ------ | ----- "
console = Console()
md = Markdown(responses)
console.print(md) Traceback
|
Thanks! I'll move this over to Rich. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
If a renderable is created by Rich.Markdown with the following string,
"| Simple | Table |\n| ------ | -----"
Textual will raise an AssertionError when the Widget is rendered. The following code will demonstrate the problem:While the offending string is not a properly formatted Markdown table, it should still render the string and not raise an exception. This was discovered trying to render Markdown output that is coming in a stream of word tokens. I've only seen the issue so far with tables, all other Markdown has rendered well, showing the raw strings until there enough tokens arrived to represent the artifact.
textual diagnose
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: