Got a new version of StructuredText from Zope's CVS.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-05-04 18:28:27 +00:00
parent e42c7b8567
commit ddfc587a2e
15 changed files with 1356 additions and 1564 deletions

View File

@@ -26,7 +26,9 @@ def insert(struct, top, level):
"""
#print "struct", struct, top-1
if not top-1 in range(len(struct)):
return None
if struct:
return struct[len(struct)-1].getSubparagraphs()
return struct
run = struct[top-1]
i = 0
while i+1 < level:
@@ -142,8 +144,11 @@ def StructuredText(paragraphs, paragraph_delimiter=re.compile('\n\s*\n')):
if result > 0:
currentlevel = result
currentindent = indent
run = insert(struct,level,currentlevel)
run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel))
if not level:
struct.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel))
else:
run = insert(struct,level,currentlevel)
run.append(StructuredTextParagraph(paragraph, indent=indent, level=currentlevel))
else:
if insert(struct,level,currentlevel):
run = insert(struct,level,currentlevel)