Keep quotes in selected text

pull/189/head
M66B 4 years ago
parent ce30a3daf7
commit 209e3fa00d

@ -3821,27 +3821,12 @@ public class FragmentCompose extends FragmentBase {
return FilterResult.CONTINUE;
}
});
} else {
// Selected text
d = Document.createShell("");
Element div = d.createElement("div");
for (String line : s.split("\\r?\\n")) {
Element span = document.createElement("span");
span.text(line);
div.appendChild(span);
div.appendElement("br");
}
d.body().appendChild(div);
}
Element e = d.body();
// Limit number of nested block quotes
boolean quote_limit = prefs.getBoolean("quote_limit", false);
if (quote_limit &&
("reply".equals(action) || "reply_all".equals(action)))
for (Element bq : e.select("blockquote")) {
for (Element bq : d.select("blockquote")) {
int level = 1;
Element parent = bq.parent();
while (parent != null) {
@ -3852,6 +3837,21 @@ public class FragmentCompose extends FragmentBase {
if (level >= MAX_QUOTE_LEVEL)
bq.html("…");
}
} else {
// Selected text
d = Document.createShell("");
Element div = d.createElement("div");
for (String line : s.split("\\r?\\n")) {
Element span = document.createElement("span");
span.text(line);
div.appendChild(span);
div.appendElement("br");
}
d.body().appendChild(div);
}
Element e = d.body();
// Apply styles
List<CSSStyleSheet> sheets = HtmlHelper.parseStyles(d.head().select("style"));

Loading…
Cancel
Save