mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +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('')
|
||||||
[]
|
[]
|
||||||
|
|
||||||
|
>>> parse_wiki('<<TableOfContents>>')
|
||||||
|
[TableOfContents()]
|
||||||
>>> parse_wiki('<<TableOfContents()>>')
|
>>> parse_wiki('<<TableOfContents()>>')
|
||||||
[TableOfContents()]
|
[TableOfContents()]
|
||||||
>>> parse_wiki('<<TableOfContents(2)>>')
|
>>> parse_wiki('<<TableOfContents(2)>>')
|
||||||
@ -1240,7 +1242,7 @@ PlainText('dialog.')])])])]
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# Table of Contents
|
# Table of Contents
|
||||||
match = re.match(r'<<TableOfContents\((\d*)\)>>', line)
|
match = re.match(r'<<TableOfContents(?:\((\d*)\))?>>', line)
|
||||||
if match:
|
if match:
|
||||||
level = match.group(1)
|
level = match.group(1)
|
||||||
if level:
|
if level:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user