From 7e681dc98f0cde2f01e6e7fec03ecb86774d3298 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 9 Oct 2016 18:39:32 +0900 Subject: [PATCH] help2rst.py: Fix * escape --- help2rst.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/help2rst.py b/help2rst.py index 7706274a..2758c497 100755 --- a/help2rst.py +++ b/help2rst.py @@ -160,9 +160,10 @@ DESCRIPTION print(line.strip()) def format_text(text): - # escape * - if len(text) > len(arg_indent): - text = text[:len(arg_indent) + 1] + re.sub(r'\*', r'\*', text[len(arg_indent) + 1:]) + # escape *, but don't escape * if it is used as bullet list. + m = re.match(r'^\s*\*\s+', text) + if m: + text = text[:len(m.group(0))] + re.sub(r'\*', r'\*', text[len(m.group(0)):]) else: text = re.sub(r'\*', r'\*', text) # markup option reference