From baa5bee92edbd84ebac55943eab82bf7330b286d Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Tue, 10 Apr 2018 14:39:47 +0300 Subject: [PATCH] Fix WikivoyageArticle#getPartialContent --- .../net/osmand/plus/wikivoyage/data/WikivoyageArticle.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageArticle.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageArticle.java index 7e00ba73fd..60c5cf823b 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageArticle.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/WikivoyageArticle.java @@ -98,15 +98,15 @@ public class WikivoyageArticle { // 4 is the length of

tag String firstParagraphHtml = content.substring(firstParagraphStart, firstParagraphEnd + 4); - String firstParagraphText = Html.fromHtml(firstParagraphHtml).toString(); + String firstParagraphText = Html.fromHtml(firstParagraphHtml).toString().trim(); String[] phrases = firstParagraphText.split("\\. "); StringBuilder res = new StringBuilder(); int limit = Math.min(phrases.length, PARTIAL_CONTENT_PHRASES); for (int i = 0; i < limit; i++) { - res.append(phrases[i]).append("."); + res.append(phrases[i]); if (i < limit - 1) { - res.append(" "); + res.append(". "); } }