diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-01-05 14:59:58 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-01-05 14:59:58 +0100 |
commit | b50c0f5b36e9b88367bacb6ca44f4791b8f7eebc (patch) | |
tree | fdb79c37144666038929bcb6d004eca0c6a083ab | |
parent | de0c78b3da8a37962327cddf7c00389478e106ea (diff) |
sfeed: fix start tags (HTML) in Atom content + style fix
-rw-r--r-- | sfeed.c | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -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); |