1.1 --- a/moinformat/serialisers/html.py Sat Jul 14 13:28:03 2018 +0200
1.2 +++ b/moinformat/serialisers/html.py Sat Jul 14 15:36:34 2018 +0200
1.3 @@ -92,14 +92,31 @@
1.4 def end_linktext(self):
1.5 pass
1.6
1.7 - # NOTE: Need to employ list type information, perhaps moving it from the
1.8 - # NOTE: individual items.
1.9 + list_tags = {
1.10 + "i" : "lower-roman",
1.11 + "I" : "upper-roman",
1.12 + "a" : "lower-latin",
1.13 + "A" : "upper-latin",
1.14 + }
1.15
1.16 - def start_list(self):
1.17 - self.out("<ul>")
1.18 + def _get_list_tag(self, marker):
1.19 + if marker:
1.20 + if marker[0].isdigit():
1.21 + return "ol", "decimal"
1.22 + style_type = self.list_tags.get(marker[0])
1.23 + if style_type:
1.24 + return "ol", style_type
1.25
1.26 - def end_list(self):
1.27 - self.out("</ul>")
1.28 + return "ul", None
1.29 +
1.30 + def start_list(self, indent, marker):
1.31 + tag, style_type = self._get_list_tag(marker)
1.32 + style = style_type and ' style="list-style-type: %s"' % escape_attr(style_type) or ""
1.33 + self.out("<%s%s>" % (tag, style))
1.34 +
1.35 + def end_list(self, indent, marker):
1.36 + tag, style = self._get_list_tag(marker)
1.37 + self.out("</%s>" % tag)
1.38
1.39 def start_listitem(self, indent, marker, space):
1.40 self.out("<li>")