From b50c0f5b36e9b88367bacb6ca44f4791b8f7eebc Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 5 Jan 2015 14:59:58 +0100 Subject: sfeed: fix start tags (HTML) in Atom content + style fix --- sfeed.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sfeed.c b/sfeed.c index 7f41fad..d27f851 100644 --- a/sfeed.c +++ b/sfeed.c @@ -552,9 +552,9 @@ xml_handler_attr(XMLParser *p, const char *tag, size_t taglen, if(ISCONTENTTAG(ctx)) { if(isattr(name, namelen, STRP("type")) && (isattr(value, valuelen, STRP("xhtml")) || - isattr(value, valuelen, STRP("text/xhtml")) || - isattr(value, valuelen, STRP("html")) || - isattr(value, valuelen, STRP("text/html")))) + isattr(value, valuelen, STRP("text/xhtml")) || + isattr(value, valuelen, STRP("html")) || + isattr(value, valuelen, STRP("text/html")))) { ctx.item.contenttype = ContentTypeHTML; ctx.iscontent = 1; @@ -575,16 +575,13 @@ xml_handler_attr(XMLParser *p, const char *tag, size_t taglen, static void xml_handler_start_element(XMLParser *p, const char *name, size_t namelen) { - if(ISCONTENTTAG(ctx)) { - /* starts with div, handle as XML, don't convert entities (set handle to NULL) */ - if(ctx.item.feedtype == FeedTypeAtom && - namelen == STRSIZ("div") && - !strncmp(name, STRP("div"))) { - p->xmldataentity = NULL; - } + /* starts with div, handle as XML, don't convert entities + * (set handler to NULL) */ + if(ISCONTENTTAG(ctx) && ctx.item.feedtype == FeedTypeAtom && + namelen == STRSIZ("div") && !strncmp(name, STRP("div"))) { + p->xmldataentity = NULL; } - /* TODO: changed, iscontenttag can be 0 or 1 ? */ - if(ISINCONTENT(ctx)) { + if(ctx.iscontent) { ctx.attrcount = 0; ctx.iscontenttag = 0; xml_handler_data(p, "<", 1); -- cgit v1.2.3