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>")
2.1 --- a/moinformat/serialisers/moin.py Sat Jul 14 13:28:03 2018 +0200
2.2 +++ b/moinformat/serialisers/moin.py Sat Jul 14 15:36:34 2018 +0200
2.3 @@ -85,10 +85,10 @@
2.4 def end_linktext(self):
2.5 pass
2.6
2.7 - def start_list(self):
2.8 + def start_list(self, indent, marker):
2.9 pass
2.10
2.11 - def end_list(self):
2.12 + def end_list(self, indent, marker):
2.13 pass
2.14
2.15 def start_listitem(self, indent, marker, space):
3.1 --- a/moinformat/tree.py Sat Jul 14 13:28:03 2018 +0200
3.2 +++ b/moinformat/tree.py Sat Jul 14 15:36:34 2018 +0200
3.3 @@ -284,9 +284,9 @@
3.4 return self._prettyprint(l, indent)
3.5
3.6 def to_string(self, out):
3.7 - out.start_list()
3.8 + out.start_list(self.indent, self.marker)
3.9 self._to_string(out)
3.10 - out.end_list()
3.11 + out.end_list(self.indent, self.marker)
3.12
3.13 class ListItem(Container):
3.14