1.1 --- a/moinformat/macros/toc.py Fri Jun 03 21:54:30 2022 +0200
1.2 +++ b/moinformat/macros/toc.py Fri Jun 03 21:54:37 2022 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Table of contents macro.
1.6
1.7 -Copyright (C) 2018, 2019 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2018, 2019, 2022 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -177,7 +177,7 @@
1.13
1.14 # Augment the macro node with the top-level list.
1.15
1.16 - self.insert_table(lists[0])
1.17 + self.insert_table(lists and lists[0] or None)
1.18
1.19 def insert_table(self, content):
1.20
1.21 @@ -189,7 +189,7 @@
1.22
1.23 # Set the children of this macro with the generated content.
1.24
1.25 - macro.nodes = [content]
1.26 + macro.nodes = content and [content]
1.27 macro.inline = False
1.28
1.29 # Split any block containing the macro into preceding and following