Support for ordered lists

This commit is contained in:
M66B 2020-01-30 11:12:26 +01:00
parent 72f69995c4
commit 4f663365b7
1 changed files with 5 additions and 1 deletions

View File

@ -507,7 +507,11 @@ public class HtmlHelper {
// Lists
for (Element li : document.select("li")) {
li.tagName("span");
li.prependText("* ");
Element parent = li.parent();
if (parent == null || "ul".equals(parent.tagName()))
li.prependText("");
else
li.prependText((li.elementSiblingIndex() + 1) + ". ");
li.appendElement("br"); // line break after list item
}
document.select("ol").tagName("div");