1.1 --- a/moinformat/serialisers/html/moin.py Fri Jun 03 18:43:44 2022 +0200
1.2 +++ b/moinformat/serialisers/html/moin.py Fri Jun 03 21:54:30 2022 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 HTML serialiser.
1.6
1.7 -Copyright (C) 2017, 2018, 2019, 2021 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2017, 2018, 2019, 2021, 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 @@ -149,6 +149,12 @@
1.13 self.out("</li>")
1.14
1.15 def start_macro(self, name, args, nodes, inline):
1.16 +
1.17 + # Special case of a deliberately unexpanded macro.
1.18 +
1.19 + if nodes is None:
1.20 + return
1.21 +
1.22 tag = inline and "span" or "div"
1.23 self.out("<%s class='macro %s'>" % (tag, escape_text(name)))
1.24
2.1 --- a/moinformat/serialisers/moin/moin.py Fri Jun 03 18:43:44 2022 +0200
2.2 +++ b/moinformat/serialisers/moin/moin.py Fri Jun 03 21:54:30 2022 +0200
2.3 @@ -3,7 +3,7 @@
2.4 """
2.5 Moin wiki text serialiser.
2.6
2.7 -Copyright (C) 2017, 2018, 2021 Paul Boddie <paul@boddie.org.uk>
2.8 +Copyright (C) 2017, 2018, 2021, 2022 Paul Boddie <paul@boddie.org.uk>
2.9
2.10 This program is free software; you can redistribute it and/or modify it under
2.11 the terms of the GNU General Public License as published by the Free Software
2.12 @@ -99,6 +99,11 @@
2.13
2.14 def start_macro(self, name, args, nodes, inline):
2.15
2.16 + # Special case of a deliberately unexpanded macro.
2.17 +
2.18 + if nodes is None:
2.19 + return
2.20 +
2.21 # Fallback case for when macros are not replaced.
2.22
2.23 if not nodes: