commit 8fa0217dbcc7fa36e08483a28cde7025af988503
parent 55a0a4a534043e160bb9defab8128febe51454b7
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 10 Apr 2016 14:45:48 +0200
sfeed_frames: dont make title of content a link if its empty
Diffstat:
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git 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. */