2019-07-07 | Paul Boddie | raw files shortlog changelog graph | Fixed the append point for containers so that text is generally added to blocks. This fixes enhanced table cells where multiple paragraphs are much more likely, but where text was being added alongside blocks, making some very untidy HTML output. | |
moinformat/tree/moin.py (file) |
1.1 --- a/moinformat/tree/moin.py Mon Jul 01 22:30:20 2019 +0200 1.2 +++ b/moinformat/tree/moin.py Sun Jul 07 23:43:10 2019 +0200 1.3 @@ -64,7 +64,12 @@ 1.4 1.5 "Return the container to which inline nodes are added." 1.6 1.7 - return self 1.8 + last = self.node(-1) 1.9 + 1.10 + if isinstance(last, Block): 1.11 + return last 1.12 + else: 1.13 + return self 1.14 1.15 def empty(self): 1.16 return not self.nodes