Merge pull request #2125 from Cj-Malone/no-shownotes-fix

Support Atom's summary tag
This commit is contained in:
Martin Fietz 2016-10-02 21:20:23 +02:00 committed by GitHub
commit 58e7118618
1 changed files with 6 additions and 2 deletions

View File

@ -30,6 +30,7 @@ public class NSAtom extends Namespace {
private static final String AUTHOR = "author";
private static final String AUTHOR_NAME = "name";
private static final String CONTENT = "content";
private static final String SUMMARY = "summary";
private static final String IMAGE_LOGO = "logo";
private static final String IMAGE_ICON = "icon";
private static final String SUBTITLE = "subtitle";
@ -59,8 +60,8 @@ public class NSAtom extends Namespace {
/**
* Regexp to test whether an Element is a Text Element.
*/
private static final String isText = TITLE + "|" + CONTENT + "|" + "|"
+ SUBTITLE;
private static final String isText = TITLE + "|" + CONTENT + "|"
+ SUBTITLE + "|" + SUMMARY;
public static final String isFeed = FEED + "|" + NSRSS20.CHANNEL;
public static final String isFeedItem = ENTRY + "|" + NSRSS20.ITEM;
@ -191,6 +192,9 @@ public class NSAtom extends Namespace {
} else if (CONTENT.equals(top) && ENTRY.equals(second) && textElement != null &&
state.getCurrentItem() != null) {
state.getCurrentItem().setDescription(textElement.getProcessedContent());
} else if (SUMMARY.equals(top) && ENTRY.equals(second) && textElement != null &&
state.getCurrentItem() != null && state.getCurrentItem().getDescription() == null) {
state.getCurrentItem().setDescription(textElement.getProcessedContent());
} else if (UPDATED.equals(top) && ENTRY.equals(second) && state.getCurrentItem() != null &&
state.getCurrentItem().getPubDate() == null) {
state.getCurrentItem().setPubDate(DateUtils.parse(content));