Commit 26fc2d04 authored by Chris McDonough's avatar Chris McDonough

The indention function returned a bogus number of spaces in front of the...

The indention function returned a bogus number of spaces in front of the string it was passed, causing subparagraphs of a paragraph that were indented by less than two spaces to appear at the same indent level as their parent paragraph.  This is now fixed, and paragraphs may be indented by a single space, just as they are in StructuredTextClassic.
parent 652f26c2
......@@ -11,9 +11,10 @@ def indention(str,front = re.compile("^\s+").match):
Find the number of leading spaces. If none, return 0
"""
if front(str):
start,end = front(str).span()
return end-start-1
result = front(str)
if result is not None:
start, end = result.span()
return end-start
else:
return 0 # no leading spaces
......
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