aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/res/values/changelog_master.xml1
-rw-r--r--main/src/cgeo/geocaching/connector/oc/OkapiClient.java5
-rw-r--r--main/src/cgeo/geocaching/utils/HtmlUtils.java3
3 files changed, 6 insertions, 3 deletions
diff --git a/main/res/values/changelog_master.xml b/main/res/values/changelog_master.xml
index 40ed5a2..6937b7d 100644
--- a/main/res/values/changelog_master.xml
+++ b/main/res/values/changelog_master.xml
@@ -17,6 +17,7 @@
· Fix: Some menus not available when invoking map from compass\n
· Fix: Do not limit to 10 logs for OC caches\n
· Fix: Recognize more hyperlinks of opencaching caches\n
+ · Fix: Remove empty space in some opencaching logs\n
\n
</string>
</resources>
diff --git a/main/src/cgeo/geocaching/connector/oc/OkapiClient.java b/main/src/cgeo/geocaching/connector/oc/OkapiClient.java
index 3b8e866..e7d4e6f 100644
--- a/main/src/cgeo/geocaching/connector/oc/OkapiClient.java
+++ b/main/src/cgeo/geocaching/connector/oc/OkapiClient.java
@@ -30,6 +30,7 @@ import cgeo.geocaching.network.OAuth;
import cgeo.geocaching.network.OAuthTokens;
import cgeo.geocaching.network.Parameters;
import cgeo.geocaching.settings.Settings;
+import cgeo.geocaching.utils.HtmlUtils;
import cgeo.geocaching.utils.JsonUtils;
import cgeo.geocaching.utils.Log;
import cgeo.geocaching.utils.SynchronizedDateFormat;
@@ -64,7 +65,7 @@ import java.util.regex.Pattern;
/**
* Client for the OpenCaching API (Okapi).
- *
+ *
* @see <a href="http://www.opencaching.de/okapi/introduction.html">Okapi overview</a>
*
*/
@@ -467,7 +468,7 @@ final class OkapiClient {
parseUser(logResponse.get(LOG_USER)),
parseDate(logResponse.get(LOG_DATE).asText()).getTime(),
parseLogType(logResponse.get(LOG_TYPE).asText()),
- logResponse.get(LOG_COMMENT).asText().trim());
+ HtmlUtils.removeExtraParagraph(logResponse.get(LOG_COMMENT).asText().trim()));
result.add(log);
} catch (final NullPointerException e) {
Log.e("OkapiClient.parseLogs", e);
diff --git a/main/src/cgeo/geocaching/utils/HtmlUtils.java b/main/src/cgeo/geocaching/utils/HtmlUtils.java
index 739acf7..ab6e8fe 100644
--- a/main/src/cgeo/geocaching/utils/HtmlUtils.java
+++ b/main/src/cgeo/geocaching/utils/HtmlUtils.java
@@ -59,7 +59,8 @@ public final class HtmlUtils {
return Html.fromHtml(result).toString().trim();
}
- public static String removeExtraParagraph(final String html) {
+ public static String removeExtraParagraph(final String htmlIn) {
+ final String html = StringUtils.trim(htmlIn);
if (StringUtils.startsWith(html, "<p>") && StringUtils.endsWith(html, "</p>")) {
final String paragraph = StringUtils.substring(html, "<p>".length(), html.length() - "</p>".length()).trim();
if (extractText(paragraph).equals(paragraph)) {