diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2012-08-06 14:24:34 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2012-08-06 14:24:34 +0200 |
commit | eb643b25cb087b69b8f84276dc9e655f80661100 (patch) | |
tree | 5029e70669fe02d4df7c84e1a969025b027555d7 | |
parent | ac006bc9180e7c79114dc9a21c134545fddcc044 (diff) |
Prioritize content:encoded over description
Prioritize content:encoded over description for RSS (untested).
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r-- | sfeed.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -292,8 +292,10 @@ xml_handler_start_element(void *data, const char *name, const char **atts) { } } } else if(feeditem.feedtype == FeedTypeRSS) { - if(istag(feeditemtag, "description")) + if((istag(feeditemtag, "description") && !feeditem.content.len) || istag(feeditemtag, "content:encoded")) { + string_clear(&feeditem.content); XML_DefaultCurrent(parser); /* pass to default handler to process inline HTML etc */ + } } if(feeditemtag[0] == '\0') /* set tag if not already set. */ strncpy(feeditemtag, name, sizeof(feeditemtag) - 1); @@ -425,7 +427,7 @@ xml_parse_stream(XML_Parser parser, FILE *fp) { void xml_handler_default(void *data, const XML_Char *s, int len) { if((feeditem.feedtype == FeedTypeAtom && (istag(feeditemtag, "summary") || istag(feeditemtag, "content"))) || - (feeditem.feedtype == FeedTypeRSS && istag(feeditemtag, "description"))) + (feeditem.feedtype == FeedTypeRSS && (istag(feeditemtag, "description") || istag(feeditemtag, "content:encoded")))) /*if(!istag(tag, "script") && !istag(tag, "style"))*/ /* ignore data in inline script and style */ string_append(&feeditem.content, s, len); } |