[BUG] Using markdown and console pager does not render the markdown with styles
Opened this issue · 4 comments
derekwallace commented
- [X ] I've checked docs and closed issues for possible solutions.
- [X ] I can't find my issue in the FAQ.
Describe the bug
Im trying to use markdown with the console pager.
Witout the pager, the rendering is correct. headings, numberd items, code etc.
When the pager is enabled most of the rendering is plain
markdown= '''
# Heading 1
## Heading 2
1. pointA
2. pointB
`im code `
'''
a = 1
if a == 1:
md= Markdown(markdown)
console = Console()
console.print(md)
if a == 2:
md= Markdown(markdown)
console = Console()
with console.pager():
console.print(md)
Output when a =2
- heading 1 is rendered.
- heading2 , numbered items and code not rendered.
github-actions commented
TomJGooding commented
Did you check the pager docs (last paragraph)? https://rich.readthedocs.io/en/latest/console.html?#paging
derekwallace commented
I tried this and it generated an exception
with console.pager(styles=True, pager='less -R'):
TomJGooding commented
MANPAGER
and PAGER
are environment variables as mentioned in the docs. If you need a quick overview of environment variables, I'd recommend checking out this video: https://www.youtube.com/watch?v=h36Xc38SDHg
For example, here's how you could use the env
utility to set MANPAGER
when running your code:
env MANPAGER="less -r" python3 my_script.py