doc: wikiparser: Handle table of contents macro without parenthesis

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2020-08-28 12:09:36 -04:00
1 parent 64fedf1f32
commit e5c51e9bb4
1 file changed
+3 -1
+3 -1
View File
@@ -832,6 +832,8 @@ def parse_wiki(text, context=None, begin_marker=None, end_marker=None):
>>> parse_wiki('')
[]
>>> parse_wiki('<<TableOfContents>>')
[TableOfContents()]
>>> parse_wiki('<<TableOfContents()>>')
[TableOfContents()]
>>> parse_wiki('<<TableOfContents(2)>>')
@@ -1240,7 +1242,7 @@ PlainText('dialog.')])])])]
continue
# Table of Contents
match = re.match(r'<<TableOfContents\((\d*)\)>>', line)
match = re.match(r'<<TableOfContents(?:\((\d*)\))?>>', line)
if match:
level = match.group(1)
if level: