Skip to content

Commit

Permalink
help2rst.py: Fix * escape
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Oct 9, 2016
1 parent 412c8f9 commit 7e681dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions help2rst.py
Expand Up @@ -160,9 +160,10 @@ def help2man(infile):
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
Expand Down

0 comments on commit 7e681dc

Please sign in to comment.