package fi.reaktor.android.rx.data;

import android.text.Html;
import android.util.Log;

import org.jsoup.Jsoup;
import org.jsoup.safety.Whitelist;

import java.io.Serializable;
import java.util.Date;

public class Article implements Serializable {
    public final Date published;
    public final String content;
    public final String title;
    public final String guid;

    public Article(Date published, String content, String title, String guid) {
        this.published = published;
        this.content = escapeContent(content);
        this.title = title;
        this.guid = guid;
    }

    private String escapeContent(String content) {
        String unescapedHtml = content.replaceAll("&nbsp;", " ");
        String withoutHtmlTags = Jsoup.clean(Html.fromHtml(unescapedHtml).toString(), Whitelist.none());
        String withoutSpecialChars = withoutHtmlTags.replaceAll("[^ \ta-zA-Z0-9_\\.,\\-\\\\/\\\\:;\\*\\+!?\"'#€%&\\(\\)\\[\\]]", "");
        return withoutSpecialChars.trim();
    }
}

@@ -59,33 +59,8 @@
 tml;
-%0Aimport android.util.Log;
 %0A%0Aim
@@ -624,74 +624,8 @@
 ) %7B%0A
-        String unescapedHtml = content.replaceAll(%22&nbsp;%22, %22 %22);%0A
     
@@ -683,21 +683,15 @@
 tml(
-unescapedHtml
+content
 ).to
@@ -865,34 +865,106 @@
     
-return withoutSpecialChars
+String unescapedHtml = withoutSpecialChars.replaceAll(%22&nbsp;%22, %22 %22);%0A        return unescapedHtml
 .tri

Fix esscaping