package com.github.mobile.android.util;

import android.text.Html.ImageGetter;

/**
 * Html Utilities
 */
public class Html {

    /**
     * Encode HTML
     *
     * @param html
     * @return html
     */
    public static CharSequence encode(String html) {
        return encode(html, null);
    }

    /**
     * Encode HTML
     *
     * @param html
     * @param imageGetter
     * @return html
     */
    public static CharSequence encode(String html, ImageGetter imageGetter) {
        if (html == null)
            return "";
        if (html.length() == 0)
            return html;
        // These add extra padding that should be styled explicitly
        if (html.startsWith("<p>") && html.endsWith("</p>"))
            html = html.substring(3, html.length() - 4);
        return android.text.Html.fromHtml(html, imageGetter, null);
    }
}

@@ -655,16 +655,139 @@
 licitly%0A
+        html = html.replace(%22%3Cp%3E%22, %22%22);%0A        html = html.replace(%22%3C/p%3E%22, %22%3Cbr%3E%22);%0A        while (html.length() %3E 0)%0A    
         
@@ -812,16 +812,78 @@
 h(%22%3C
-p%3E%22) && 
+br%3E%22))%0A                html = html.substring(4);%0A            else if (
 html
@@ -894,18 +894,18 @@
 sWith(%22%3C
-/p
+br
 %3E%22))%0A   
@@ -905,32 +905,36 @@
 %22))%0A            
+    
 html = html.subs
@@ -943,9 +943,9 @@
 ing(
-3
+0
 , ht
@@ -958,24 +958,64 @@
 gth() - 4);%0A
+            else%0A                break;%0A
         retu

Drop <p> tags and replace </p> with <br>