# HG changeset patch # User Paul Boddie # Date 1654286070 -7200 # Node ID a1a322d095bde2f7df143971a84bca4dd02cdd44 # Parent 6cc0a83cc21e31fc5aaa3ace6061479fe63ec5da Permit the suppression of macro output if the child nodes are set to None. diff -r 6cc0a83cc21e -r a1a322d095bd moinformat/serialisers/html/moin.py --- a/moinformat/serialisers/html/moin.py Fri Jun 03 18:43:44 2022 +0200 +++ b/moinformat/serialisers/html/moin.py Fri Jun 03 21:54:30 2022 +0200 @@ -3,7 +3,7 @@ """ HTML serialiser. -Copyright (C) 2017, 2018, 2019, 2021 Paul Boddie +Copyright (C) 2017, 2018, 2019, 2021, 2022 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -149,6 +149,12 @@ self.out("") def start_macro(self, name, args, nodes, inline): + + # Special case of a deliberately unexpanded macro. + + if nodes is None: + return + tag = inline and "span" or "div" self.out("<%s class='macro %s'>" % (tag, escape_text(name))) diff -r 6cc0a83cc21e -r a1a322d095bd moinformat/serialisers/moin/moin.py --- a/moinformat/serialisers/moin/moin.py Fri Jun 03 18:43:44 2022 +0200 +++ b/moinformat/serialisers/moin/moin.py Fri Jun 03 21:54:30 2022 +0200 @@ -3,7 +3,7 @@ """ Moin wiki text serialiser. -Copyright (C) 2017, 2018, 2021 Paul Boddie +Copyright (C) 2017, 2018, 2021, 2022 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -99,6 +99,11 @@ def start_macro(self, name, args, nodes, inline): + # Special case of a deliberately unexpanded macro. + + if nodes is None: + return + # Fallback case for when macros are not replaced. if not nodes: