Textualize / rich

Rich is a Python library for rich text and beautiful formatting in the terminal.
https://rich.readthedocs.io/en/latest/
MIT License
49.58k stars 1.73k forks source link

[BUG] Text interpreted as html tag in markdown gets swallowed. #3565

Open brianm78 opened 5 hours ago

brianm78 commented 5 hours ago

Describe the bug

If markdown contains code with text that could be interpreted as html (eg. using "<" rather than entity escaping it), the text interpreted as a tag deleted. Eg

>>> md = Markdown("Do something if 0<foo or foo>10")
>>> console.print(md)
Do something if 010

Unless there's actual support for html, I think the html_inline rule should be disabled (or if this is used by something, add an option for markdown without html?). Changing the first line of markdown.Markdown.init to:

parser = MarkdownIt().enable("strikethrough").enable("table").disable("html_inline")

Seems to resolve the issue.

Platform

Click to expand Running on linux, rich 13.9.4, wezterm terminal.
github-actions[bot] commented 5 hours ago

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