Commit 7e681dc9 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

help2rst.py: Fix * escape

parent 412c8f9e
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment