1.1 --- a/moinformat/serialisers/html/moin.py Fri Apr 12 19:00:08 2019 +0200
1.2 +++ b/moinformat/serialisers/html/moin.py Sat Apr 13 00:03:24 2019 +0200
1.3 @@ -265,19 +265,25 @@
1.4 self.out(" ")
1.5 node.to_string(self)
1.6
1.7 - self.out(">")
1.8 + # Close the tag if an image.
1.9 +
1.10 + if tag == "img":
1.11 + self.out(" />")
1.12
1.13 # Provide the link label if specified. Otherwise, use a generated
1.14 # default for the label.
1.15
1.16 - for node in nodes or []:
1.17 - if isinstance(node, LinkLabel):
1.18 - node.to_string(self)
1.19 - break
1.20 else:
1.21 - self.out(escape_text(link.get_label()))
1.22 + self.out(">")
1.23
1.24 - self.out("</%s>" % tag)
1.25 + for node in nodes or []:
1.26 + if isinstance(node, LinkLabel):
1.27 + node.to_string(self)
1.28 + break
1.29 + else:
1.30 + self.out(escape_text(link.get_label()))
1.31 +
1.32 + self.out("</%s>" % tag)
1.33
1.34 def link(self, target, nodes):
1.35 self._link(target, nodes, "a", "href")