diff --git a/src/com/fsck/k9/helper/HtmlConverter.java b/src/com/fsck/k9/helper/HtmlConverter.java
index a6accb524..54eb34faf 100644
--- a/src/com/fsck/k9/helper/HtmlConverter.java
+++ b/src/com/fsck/k9/helper/HtmlConverter.java
@@ -248,7 +248,11 @@ public class HtmlConverter {
if (isStartOfLine) {
quotesThisLine++;
} else {
- buff.append(">");
+ // We use a token here which can't occur in htmlified text because > is valid
+ // within links (where > is not), and linkifying links will include it if we
+ // do it here. We'll make another pass and change this back to > after
+ // the linkification is done.
+ buff.append("");
}
break;
case '\r':
@@ -322,6 +326,9 @@ public class HtmlConverter {
text = sb.toString();
+ // Above we replaced > with , now make it >
+ text = text.replaceAll("", ">");
+
return text;
}