mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-28 02:37:16 +00:00
Prevent extra newline at end
This commit is contained in:
parent
8c1866f266
commit
263c10f594
1 changed files with 6 additions and 0 deletions
|
@ -289,6 +289,12 @@ public class HtmlHelper {
|
||||||
static Document sanitizeCompose(Context context, String html, boolean show_images) {
|
static Document sanitizeCompose(Context context, String html, boolean show_images) {
|
||||||
try {
|
try {
|
||||||
Document parsed = JsoupEx.parse(html);
|
Document parsed = JsoupEx.parse(html);
|
||||||
|
|
||||||
|
// Prevent extra newline at end
|
||||||
|
Element body = parsed.body();
|
||||||
|
if (body != null && body.childrenSize() == 1 && "p".equals(body.child(0).tagName()))
|
||||||
|
body.child(0).tagName("span").appendChild(new Element("br"));
|
||||||
|
|
||||||
return sanitize(context, parsed, false, show_images);
|
return sanitize(context, parsed, false, show_images);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
// OutOfMemoryError
|
// OutOfMemoryError
|
||||||
|
|
Loading…
Reference in a new issue