# HG changeset patch # User Paul Boddie # Date 1635116045 -7200 # Node ID bc2834224ef70c3d829a09ddd142cb5c4505646c # Parent 4474f27d4b25971cf218cb38acc2d029335a25ed Moved the region's add method to the general container abstraction since such functionality is useful for other nodes such as table cells provided by the table parser. diff -r 4474f27d4b25 -r bc2834224ef7 moinformat/tree/moin.py --- a/moinformat/tree/moin.py Mon Oct 25 00:52:27 2021 +0200 +++ b/moinformat/tree/moin.py Mon Oct 25 00:54:05 2021 +0200 @@ -38,7 +38,12 @@ for node in nodes: self.append(node) - add = append + def add(self, node): + last = self.node(-1) + if last and last.empty(): + self.nodes[-1] = node + else: + self.append(node) def append_inline(self, node): @@ -195,13 +200,6 @@ self.transparent = transparent self.extra = extra - def add(self, node): - last = self.node(-1) - if last and last.empty(): - self.nodes[-1] = node - else: - self.append(node) - def append_point(self): "Return the container to which inline nodes are added."