mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 03:15:39 +01:00
Flatten list for editor
This commit is contained in:
@@ -1269,8 +1269,8 @@ public class HtmlHelper {
|
||||
|
||||
// Lists
|
||||
for (Element e : document.select("ol,ul,blockquote")) {
|
||||
Element parent = e.parent();
|
||||
if (view) {
|
||||
Element parent = e.parent();
|
||||
if ("blockquote".equals(e.tagName()) || parent == null ||
|
||||
!("li".equals(parent.tagName()) ||
|
||||
"ol".equals(parent.tagName()) ||
|
||||
@@ -1299,6 +1299,20 @@ public class HtmlHelper {
|
||||
}
|
||||
e.attr("dir", rtl > ltr ? "rtl" : "ltr");
|
||||
}
|
||||
|
||||
// Flatten list for editor
|
||||
if (parent != null && "li".equals(parent.tagName())) {
|
||||
List<Node> children = parent.childNodes();
|
||||
for (Node child : children) {
|
||||
child.remove();
|
||||
if (child instanceof Element &&
|
||||
"ol".equals(child.nodeName()) || "ul".equals(child.nodeName()))
|
||||
parent.before(child);
|
||||
else
|
||||
parent.before(document.createElement("li").appendChild(child));
|
||||
}
|
||||
parent.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user