summaryrefslogtreecommitdiff
path: root/sfeed_opml_import.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2019-11-24 15:11:48 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2019-11-24 15:11:48 +0100
commit7ab5fc54b9671ee435a6258892b667196c4ad598 (patch)
tree56f5577c39456c50961d7e116d7047750d818178 /sfeed_opml_import.c
parent5cf169e88e97cdaa15a302a5cb7d28ce5132be3e (diff)
sfeed_opml_import: improve import with nested <outline>
This nested format is used by Mozilla Thunderbird: <outline title=""> <outline type="rss" title="" text="" xmlUrl=""/> </outline> other tests: - newsboat -e uses the title attribute, not text. - rss2email 3.x, r2e opmlexport uses type, text and xmlUrl (correct).
Diffstat (limited to 'sfeed_opml_import.c')
-rw-r--r--sfeed_opml_import.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sfeed_opml_import.c b/sfeed_opml_import.c
index 03c7da3..df74cc9 100644
--- a/sfeed_opml_import.c
+++ b/sfeed_opml_import.c
@@ -30,6 +30,12 @@ printsafe(const char *s)
}
static void
+xmltagstart(XMLParser *p, const char *t, size_t tl)
+{
+ url[0] = text[0] = title[0] = '\0';
+}
+
+static void
xmltagend(XMLParser *p, const char *t, size_t tl, int isshort)
{
if (strcasecmp(t, "outline"))
@@ -47,6 +53,7 @@ xmltagend(XMLParser *p, const char *t, size_t tl, int isshort)
printsafe(url);
fputs("'\n", stdout);
}
+
url[0] = text[0] = title[0] = '\0';
}
@@ -88,6 +95,7 @@ main(void)
parser.xmlattr = xmlattr;
parser.xmlattrentity = xmlattrentity;
+ parser.xmltagstart = xmltagstart;
parser.xmltagend = xmltagend;
fputs(