summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2016-04-10 14:45:48 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-04-10 14:45:48 +0200
commit8fa0217dbcc7fa36e08483a28cde7025af988503 (patch)
treef143489786631e8989a8425a59783eb0da70841f
parent55a0a4a534043e160bb9defab8128febe51454b7 (diff)
sfeed_frames: dont make title of content a link if its empty
-rw-r--r--sfeed_frames.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sfeed_frames.c b/sfeed_frames.c
index 35fe07e..9431842 100644
--- a/sfeed_frames.c
+++ b/sfeed_frames.c
@@ -169,11 +169,18 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f)
"<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style.css\" />"
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />"
"</head>\n<body class=\"frame\">"
- "<div class=\"content\"><h2><a href=\"", fpcontent);
- xmlencode(fields[FieldLink], fpcontent);
- fputs("\">", fpcontent);
+ "<div class=\"content\"><h2>", fpcontent);
+
+ if (fields[FieldLink][0]) {
+ fputs("<a href=\"", fpcontent);
+ xmlencode(fields[FieldLink], fpcontent);
+ fputs("\">", fpcontent);
+ }
xmlencode(fields[FieldTitle], fpcontent);
- fputs("</a></h2>", fpcontent);
+ if (fields[FieldLink][0])
+ fputs("</a>", fpcontent);
+ fputs("</h2>", fpcontent);
+
/* NOTE: this prints the raw HTML of the feed, this is
* potentially dangerous, it is left up to the
* user / browser to trust a feed it's HTML content. */