mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-15 09:51:21 +00:00
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:
parent
64fedf1f32
commit
e5c51e9bb4
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user