Add support for ol/type attribute

pull/194/merge
M66B 4 years ago
parent 24f3142144
commit 08fefb8510

@ -3092,13 +3092,17 @@ public class HtmlHelper {
int level = 0;
Element list = null;
String ltype = element.attr("x-list-style");
String ltype = element.attr("type");
if (TextUtils.isEmpty(ltype))
ltype = element.attr("x-list-style");
Element parent = element.parent();
while (parent != null) {
if ("ol".equals(parent.tagName()) || "ul".equals(parent.tagName())) {
level++;
if (list == null)
list = parent;
if (TextUtils.isEmpty(ltype))
ltype = parent.attr("type");
if (TextUtils.isEmpty(ltype))
ltype = parent.attr("x-list-style");
}

@ -79,17 +79,21 @@ public class NumberSpan extends BulletSpan {
number = index + ".";
else {
switch (type) {
case "a":
case "lower-alpha":
case "lower-latin":
number = Character.toString((char) ((int) 'a' + index));
break;
case "A":
case "upper-alpha":
case "upper-latin":
number = Character.toString((char) ((int) 'A' + index));
break;
case "i":
case "lower-roman":
number = Helper.toRoman(index).toLowerCase(Locale.ROOT);
break;
case "I":
case "upper-roman":
number = Helper.toRoman(index);
break;

Loading…
Cancel
Save