From c9a440b56585911095824c1775f8830af8552452 Mon Sep 17 00:00:00 2001 From: Ethan Kinnear <51250849+superatomic@users.noreply.github.com> Date: Sat, 6 Aug 2022 22:22:51 -0500 Subject: [PATCH] Escape preexisting asterisks in tldr-pages Fixes incorrect styling in pages that contain asterisk characters --- src/tldr_man/pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tldr_man/pages.py b/src/tldr_man/pages.py index 2537bf2..2bb3275 100644 --- a/src/tldr_man/pages.py +++ b/src/tldr_man/pages.py @@ -195,7 +195,7 @@ def render_manpage(tldr_page: str) -> Optional[str]: if not line: continue - indicator, contents = line[0], line[1:].strip().replace(r'\\', r'\e') + indicator, contents = line[0], line[1:].strip().replace(r'\\', r'\e').replace('*', r'\*') match indicator: case '-': examples.append(f'\n**{contents}**\n')