diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java index 13359726b..9e622d7ae 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java @@ -22,8 +22,10 @@ import java.io.File; import java.text.DecimalFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.UUID; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -134,7 +136,32 @@ public static String getHtmlPage(RequestManager glide, RssItem rssItem, boolean } String description = rssItem.getBody(); - if(description.isEmpty() && rssItem.getMediaDescription() != null) { + + if (!description.isEmpty()) { + // UUID is used so there is only a very small chance that the placeholder text actually exists in the article + var uuid = UUID.randomUUID().toString(); + + // pre-blocks shouldn't have their newlines replaced + var matcher = Pattern.compile("
(.*?)", Pattern.MULTILINE | Pattern.DOTALL).matcher(description); + var preBlocks = new ArrayList