From 0767cf3d442e612d7e70b064b1ce7be983f354da Mon Sep 17 00:00:00 2001 From: Kseniia Date: Mon, 22 Feb 2021 14:45:11 +0200 Subject: [PATCH] fix description --- OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java index 7b72024b12..02f31efe8e 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleHelper.java @@ -300,8 +300,9 @@ public class WikiArticleHelper { if (firstParagraphStart != -1 && firstParagraphEnd != -1 && firstParagraphEnd >= firstParagraphStart) { firstParagraphHtml = content.substring(firstParagraphStart, firstParagraphEnd + P_CLOSED.length()); - while (firstParagraphHtml.substring(P_OPENED.length(), firstParagraphHtml.length() - P_CLOSED.length()).trim().isEmpty() - && (firstParagraphEnd + P_CLOSED.length()) < content.length()) { + while ((firstParagraphHtml.substring(P_OPENED.length(), firstParagraphHtml.length() - P_CLOSED.length()).trim().isEmpty() + && (firstParagraphEnd + P_CLOSED.length()) < content.length()) + || Html.fromHtml(firstParagraphHtml.replaceAll("()|()", "")).toString().trim().length() == 0) { firstParagraphStart = content.indexOf(P_OPENED, firstParagraphEnd); firstParagraphEnd = firstParagraphStart == -1 ? -1 : content.indexOf(P_CLOSED, firstParagraphStart); if (firstParagraphStart != -1 && firstParagraphEnd != -1) {