mirror of https://github.com/readrops/Readrops.git
improve image detection by providing only body children nodes
This commit is contained in:
parent
90d15c57b2
commit
76aef3916a
|
@ -124,6 +124,7 @@ public class ItemActivity extends AppCompatActivity {
|
||||||
toolbarLayout.setTitle(itemWithFeed.getFeedName());
|
toolbarLayout.setTitle(itemWithFeed.getFeedName());
|
||||||
|
|
||||||
title.setText(item.getTitle());
|
title.setText(item.getTitle());
|
||||||
|
|
||||||
if (itemWithFeed.getBgColor() != 0)
|
if (itemWithFeed.getBgColor() != 0)
|
||||||
title.setTextColor(itemWithFeed.getBgColor());
|
title.setTextColor(itemWithFeed.getBgColor());
|
||||||
else if (itemWithFeed.getColor() != 0)
|
else if (itemWithFeed.getColor() != 0)
|
||||||
|
|
|
@ -116,8 +116,9 @@ public final class HtmlParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String deleteCoverImage(String content) {
|
public static String deleteCoverImage(String content) {
|
||||||
if (Pattern.compile(COVER_IMAGE_REGEX).matcher(content).find()) {
|
Document document = Jsoup.parse(content);
|
||||||
Document document = Jsoup.parse(content);
|
|
||||||
|
if (Pattern.compile(COVER_IMAGE_REGEX).matcher(document.body().html()).find()) {
|
||||||
Elements elements = document.select("img");
|
Elements elements = document.select("img");
|
||||||
|
|
||||||
if (!elements.isEmpty())
|
if (!elements.isEmpty())
|
||||||
|
|
Loading…
Reference in New Issue