Merge pull request #10975 from osmandapp/TDesc3.9

Fix description
This commit is contained in:
vshcherb 2021-02-23 11:59:16 +02:00 committed by GitHub
commit 6837c21f48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -300,8 +300,9 @@ public class WikiArticleHelper {
if (firstParagraphStart != -1 && firstParagraphEnd != -1 if (firstParagraphStart != -1 && firstParagraphEnd != -1
&& firstParagraphEnd >= firstParagraphStart) { && firstParagraphEnd >= firstParagraphStart) {
firstParagraphHtml = content.substring(firstParagraphStart, firstParagraphEnd + P_CLOSED.length()); firstParagraphHtml = content.substring(firstParagraphStart, firstParagraphEnd + P_CLOSED.length());
while (firstParagraphHtml.substring(P_OPENED.length(), firstParagraphHtml.length() - P_CLOSED.length()).trim().isEmpty() while ((firstParagraphHtml.substring(P_OPENED.length(), firstParagraphHtml.length() - P_CLOSED.length()).trim().isEmpty()
&& (firstParagraphEnd + P_CLOSED.length()) < content.length()) { && (firstParagraphEnd + P_CLOSED.length()) < content.length())
|| Html.fromHtml(firstParagraphHtml.replaceAll("(<a.+?/a>)|(<div.+?/div>)", "")).toString().trim().length() == 0) {
firstParagraphStart = content.indexOf(P_OPENED, firstParagraphEnd); firstParagraphStart = content.indexOf(P_OPENED, firstParagraphEnd);
firstParagraphEnd = firstParagraphStart == -1 ? -1 : content.indexOf(P_CLOSED, firstParagraphStart); firstParagraphEnd = firstParagraphStart == -1 ? -1 : content.indexOf(P_CLOSED, firstParagraphStart);
if (firstParagraphStart != -1 && firstParagraphEnd != -1) { if (firstParagraphStart != -1 && firstParagraphEnd != -1) {