diff --git a/ChangeLog b/ChangeLog index 18c19fa91..75be0b1bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ ===== 1.6.4 (Nov ??, 2012) ===== * Supported encoding & language detection for *.doc (ms-word) files +* Fixed crash in book info dialogs on some epubs (on Jelly Bean devices), code taken from https://gist.github.com/3424004 +* Fixed some problems in interaction with TTS+ plugin (by Greg Kochaniak) ===== 1.6.3 (Oct 22, 2012) ===== * FBReader stores text position after setPageStart API method (useful for TTS plugin, code by Greg Kochaniak) diff --git a/src/org/geometerplus/fbreader/network/HtmlUtil.java b/src/org/geometerplus/fbreader/network/HtmlUtil.java index ff6b1b0b3..cd5794a69 100644 --- a/src/org/geometerplus/fbreader/network/HtmlUtil.java +++ b/src/org/geometerplus/fbreader/network/HtmlUtil.java @@ -20,38 +20,12 @@ package org.geometerplus.fbreader.network; import java.util.HashMap; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import android.text.*; import android.text.style.URLSpan; public abstract class HtmlUtil { - private static final HashMap ourTagPatterns = new HashMap(); - - private static String removeNestedTags(String text, String tag) { - Pattern pattern = ourTagPatterns.get(tag); - if (pattern == null) { - pattern = Pattern.compile("(<" + tag + ">.*)(.*)"); - } - final Matcher matcher = pattern.matcher(text); - while (matcher.find()) { - text = matcher.replaceAll("$1 $2"); - matcher.reset(text); - } - return text; - } - - private static String removeNestedTags(String text, String[] tags) { - for (String t : tags) { - text = removeNestedTags(text, t); - } - return text; - } - public static CharSequence getHtmlText(String text) { - // fixes an android bug (?): text layout fails on text with nested style tags - text = removeNestedTags(text, new String[] { "i", "b", "strong" }); final Spanned htmlText = Html.fromHtml(text); if (htmlText.getSpans(0, htmlText.length(), URLSpan.class).length == 0) { return htmlText;