diff --git a/app/core/src/main/java/com/fsck/k9/message/html/EmailTextToHtml.kt b/app/core/src/main/java/com/fsck/k9/message/html/EmailTextToHtml.kt index 10d5c2c3c..13cdd6983 100644 --- a/app/core/src/main/java/com/fsck/k9/message/html/EmailTextToHtml.kt +++ b/app/core/src/main/java/com/fsck/k9/message/html/EmailTextToHtml.kt @@ -22,7 +22,7 @@ class EmailTextToHtml private constructor(private val text: String) { } private fun appendHtmlPrefix() { - html.append("
")
+        html.append("
")
     }
 
     private fun appendHtmlSuffix() {
diff --git a/app/core/src/test/java/com/fsck/k9/mailstore/MessageViewInfoExtractorTest.java b/app/core/src/test/java/com/fsck/k9/mailstore/MessageViewInfoExtractorTest.java
index 880163b30..6c374556a 100644
--- a/app/core/src/test/java/com/fsck/k9/mailstore/MessageViewInfoExtractorTest.java
+++ b/app/core/src/test/java/com/fsck/k9/mailstore/MessageViewInfoExtractorTest.java
@@ -124,7 +124,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest {
         ViewableExtractedText container = messageViewInfoExtractor.extractTextFromViewables(outputViewableParts);
 
         String expectedHtml =
-                "
" +
+                "
" +
                 "K-9 Mail rocks :>" +
                 "
"; @@ -151,7 +151,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { String expectedText = "K-9 Mail rocks :> flowed line\r\n" + "not flowed line"; String expectedHtml = - "
" +
+                "
" +
                         "K-9 Mail rocks :> flowed line
not flowed line" + "
"; @@ -212,12 +212,12 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { "------------------------------------------------------------------------\r\n\r\n" + bodyText2; String expectedHtml = - "
" +
+                "
" +
                 bodyText1 +
                 "
" + "

" + - "
" +
+                "
" +
                 bodyText2 +
                 "
"; @@ -278,7 +278,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { "\r\n" + innerBodyText; String expectedHtml = - "
" +
+                "
" +
                         BODY_TEXT_HTML +
                 "
" + "

Subject" + "" + "" + - "

" +
+                "
" +
                 innerBodyText +
                 "
"; @@ -354,12 +354,12 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { String expectedHtmlText = "" + "" + "
Subject:(No subject)
" + - "
text body of first message
" + + "
text body of first message
" + "

" + "" + "" + "
Subject:subject of second message
" + - "
text part of second message
"; + "
text part of second message
"; assertEquals(4, outputViewableParts.size()); @@ -387,7 +387,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { false); - assertEquals("
text
", messageViewInfo.text); + assertEquals("
text
", messageViewInfo.text); assertSame(attachmentViewInfo, messageViewInfo.attachments.get(0)); assertNull(messageViewInfo.cryptoResultAnnotation); assertTrue(messageViewInfo.extraAttachments.isEmpty()); @@ -409,7 +409,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { false); - assertEquals("
text
", messageViewInfo.text); + assertEquals("
text
", messageViewInfo.text); assertSame(annotation, messageViewInfo.cryptoResultAnnotation); assertSame(message, messageViewInfo.message); assertSame(message, messageViewInfo.rootPart); @@ -434,7 +434,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { false); - assertEquals("
replacement text
", messageViewInfo.text); + assertEquals("
replacement text
", messageViewInfo.text); assertSame(annotation, messageViewInfo.cryptoResultAnnotation); assertSame(message, messageViewInfo.message); assertSame(replacementPart, messageViewInfo.rootPart); @@ -462,7 +462,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { false); - assertEquals("
text
", messageViewInfo.text); + assertEquals("
text
", messageViewInfo.text); assertSame(annotation, messageViewInfo.cryptoResultAnnotation); assertEquals("extra text", messageViewInfo.extraText); assertTrue(messageViewInfo.attachments.isEmpty()); @@ -492,7 +492,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { false); - assertEquals("
text
", messageViewInfo.text); + assertEquals("
text
", messageViewInfo.text); assertSame(annotation, messageViewInfo.cryptoResultAnnotation); assertSame(attachmentViewInfo, messageViewInfo.extraAttachments.get(0)); assertTrue(messageViewInfo.attachments.isEmpty()); @@ -533,7 +533,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { true); assertSame(openPgpResultAnnotation, messageViewInfo.cryptoResultAnnotation); - assertEquals("
encrypted text
", messageViewInfo.text); + assertEquals("
encrypted text
", messageViewInfo.text); assertTrue(messageViewInfo.attachments.isEmpty()); assertTrue(messageViewInfo.extraAttachments.isEmpty()); } @@ -560,7 +560,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { true); assertSame(openPgpResultAnnotation, messageViewInfo.cryptoResultAnnotation); - assertEquals("
encrypted text
", messageViewInfo.text); + assertEquals("
encrypted text
", messageViewInfo.text); assertEquals(PROTECTED_SUBJECT, messageViewInfo.subject); assertTrue(messageViewInfo.attachments.isEmpty()); assertTrue(messageViewInfo.extraAttachments.isEmpty()); @@ -578,7 +578,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { MessageViewInfo messageViewInfo = messageViewInfoExtractor.extractMessageForView(message, null, false); - assertEquals("
text
", messageViewInfo.text); + assertEquals("
text
", messageViewInfo.text); assertNull(messageViewInfo.cryptoResultAnnotation); assertTrue(messageViewInfo.attachments.isEmpty()); assertTrue(messageViewInfo.extraAttachments.isEmpty()); @@ -602,7 +602,7 @@ public class MessageViewInfoExtractorTest extends K9RobolectricTest { MessageViewInfo messageViewInfo = messageViewInfoExtractor.extractMessageForView(message, null, false); - assertEquals("
text
", messageViewInfo.text); + assertEquals("
text
", messageViewInfo.text); assertNull(messageViewInfo.cryptoResultAnnotation); assertSame(mock, messageViewInfo.attachments.get(0)); assertTrue(messageViewInfo.extraAttachments.isEmpty()); diff --git a/app/core/src/test/java/com/fsck/k9/message/html/HtmlConverterTest.java b/app/core/src/test/java/com/fsck/k9/message/html/HtmlConverterTest.java index 3b8c1423d..103fe1afc 100644 --- a/app/core/src/test/java/com/fsck/k9/message/html/HtmlConverterTest.java +++ b/app/core/src/test/java/com/fsck/k9/message/html/HtmlConverterTest.java @@ -23,7 +23,7 @@ public class HtmlConverterTest { String result = HtmlConverter.textToHtml(message); - assertEquals("
"
+        assertEquals("
"
                 + "Panama!
" + "
" + "Bob Barker <bob@aol.com> wrote:
" @@ -63,7 +63,7 @@ public class HtmlConverterTest { String result = HtmlConverter.textToHtml(message); - assertEquals("
"
+        assertEquals("
"
                 + "*facepalm*
" + "
" + "Bob Barker <bob@aol.com> wrote:
" @@ -89,7 +89,7 @@ public class HtmlConverterTest { String result = HtmlConverter.textToHtml(message); - assertEquals("
"
+        assertEquals("
"
                 + "zero
" + "
" + "one
" @@ -120,7 +120,7 @@ public class HtmlConverterTest { String result = HtmlConverter.textToHtml(message); - assertEquals("
"
+        assertEquals("
"
                 + "foo
" + " bar
" + " baz
" @@ -138,7 +138,7 @@ public class HtmlConverterTest { String result = HtmlConverter.textToHtml(message); - assertEquals("
"
+        assertEquals("
"
                 + " 
" + " &
" + "
" @@ -163,7 +163,7 @@ public class HtmlConverterTest { "-- 8< --\n" + "end"; String result = HtmlConverter.textToHtml(text); - assertEquals("
text
" + + assertEquals("
text
" + "some other text
" + "more text
" + "scissors below
" + @@ -176,7 +176,7 @@ public class HtmlConverterTest { public void dashesContainingSpacesIgnoredAsHR() { String text = "hello\n--- --- --- --- ---\nfoo bar"; String result = HtmlConverter.textToHtml(text); - assertEquals("
hello
--- --- --- --- ---
foo bar
", + assertEquals("
hello
--- --- --- --- ---
foo bar
", result); } @@ -184,70 +184,70 @@ public class HtmlConverterTest { public void mergeConsecutiveBreaksIntoOne() { String text = "hello\n------------\n---------------\nfoo bar"; String result = HtmlConverter.textToHtml(text); - assertEquals("
hello
foo bar
", result); + assertEquals("
hello
foo bar
", result); } @Test public void dashedHorizontalRulePrefixedWithTextIgnoredAsHR() { String text = "hello----\n\n"; String result = HtmlConverter.textToHtml(text); - assertEquals("
hello----

", result); + assertEquals("
hello----

", result); } @Test public void doubleMinusIgnoredAsHR() { String text = "--\n"; String result = HtmlConverter.textToHtml(text); - assertEquals("
--
", result); + assertEquals("
--
", result); } @Test public void doubleEqualsIgnoredAsHR() { String text = "==\n"; String result = HtmlConverter.textToHtml(text); - assertEquals("
==
", result); + assertEquals("
==
", result); } @Test public void doubleUnderscoreIgnoredAsHR() { String text = "__\n"; String result = HtmlConverter.textToHtml(text); - assertEquals("
__
", result); + assertEquals("
__
", result); } @Test public void anyTripletIsHRuledOut() { String text = "--=\n-=-\n===\n___\n\n"; String result = HtmlConverter.textToHtml(text); - assertEquals("

", result); + assertEquals("

", result); } @Test public void replaceSpaceSeparatedDashesWithHR() { String text = "hello\n---------------------------\nfoo bar"; String result = HtmlConverter.textToHtml(text); - assertEquals("
hello
foo bar
", result); + assertEquals("
hello
foo bar
", result); } @Test public void replacementWithHRAtBeginning() { String text = "---------------------------\nfoo bar"; String result = HtmlConverter.textToHtml(text); - assertEquals("

foo bar
", result); + assertEquals("

foo bar
", result); } @Test public void replacementWithHRAtEnd() { String text = "hello\n__________________________________"; String result = HtmlConverter.textToHtml(text); - assertEquals("
hello
", result); + assertEquals("
hello
", result); } @Test public void replacementOfScissorsByHR() { String text = "hello\n-- %< -------------- >8 --\nworld\n"; String result = HtmlConverter.textToHtml(text); - assertEquals("
hello
world
", result); + assertEquals("
hello
world
", result); } @Test