help2rst.py: Fix * escape
This commit is contained in:
parent
412c8f9e67
commit
7e681dc98f
|
@ -160,9 +160,10 @@ DESCRIPTION
|
||||||
print(line.strip())
|
print(line.strip())
|
||||||
|
|
||||||
def format_text(text):
|
def format_text(text):
|
||||||
# escape *
|
# escape *, but don't escape * if it is used as bullet list.
|
||||||
if len(text) > len(arg_indent):
|
m = re.match(r'^\s*\*\s+', text)
|
||||||
text = text[:len(arg_indent) + 1] + re.sub(r'\*', r'\*', text[len(arg_indent) + 1:])
|
if m:
|
||||||
|
text = text[:len(m.group(0))] + re.sub(r'\*', r'\*', text[len(m.group(0)):])
|
||||||
else:
|
else:
|
||||||
text = re.sub(r'\*', r'\*', text)
|
text = re.sub(r'\*', r'\*', text)
|
||||||
# markup option reference
|
# markup option reference
|
||||||
|
|
Loading…
Reference in New Issue