From f282386ab06d0a36c06195d7dd75e4a0e897bad1 Mon Sep 17 00:00:00 2001 From: David Miller Date: Tue, 18 Dec 2012 09:25:38 -0500 Subject: [PATCH] Fix issue 4771 - work around > getting included in URLs when linkifying text/plain emails --- src/com/fsck/k9/helper/HtmlConverter.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; }