projects
/
prss.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
& must be encoded as &
[prss.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index
20b9b14
..
b9e6860
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-32,6
+32,7
@@
#include <config.h>
#include "http.h"
#include <plog.h>
#include <config.h>
#include "http.h"
#include <plog.h>
+#include <pstr.h>
#include "ttrss.h"
#include "ttrss_ws.h"
#include "webbrowser.h"
#include "ttrss.h"
#include "ttrss_ws.h"
#include "webbrowser.h"
@@
-282,12
+283,25
@@
static struct headline *get_selected_headline(GtkTreeIter *iter)
return NULL;
}
return NULL;
}
+static char *headline_to_markup(struct headline *h)
+{
+ return strrepg(h->title, "&", "&");
+}
+
static char *headline_get_formated_headline(struct headline *h)
{
static char *headline_get_formated_headline(struct headline *h)
{
+ char *tmp, *res;
+
+ tmp = headline_to_markup(h);
+
if (h->unread)
if (h->unread)
- re
turn g_strdup_printf("<b>%s</b>", h->title
);
+ re
s = g_strdup_printf("<b>%s</b>", tmp
);
else
else
- return strdup(h->title);
+ res = strdup(tmp);
+
+ free(tmp);
+
+ return res;
}
static char *headline_get_date(struct headline *h)
}
static char *headline_get_date(struct headline *h)
@@
-367,7
+381,7
@@
int headline_cursor_changed_cbk(GtkTreeView *treeview, gpointer data)
GtkTreeIter iter;
GtkTreeModel *model;
struct headline *headline;
GtkTreeIter iter;
GtkTreeModel *model;
struct headline *headline;
- char *str, *date;
+ char *str, *date
, *title
;
log_debug("headline_cursor_changed_cbk()");
log_debug("headline_cursor_changed_cbk()");
@@
-377,7
+391,9
@@
int headline_cursor_changed_cbk(GtkTreeView *treeview, gpointer data)
headline = get_selected_headline(&iter);
if (headline) {
headline = get_selected_headline(&iter);
if (headline) {
- gtk_label_set_text(w_headline_title, headline->title);
+ title = headline_to_markup(headline);
+ gtk_label_set_markup(w_headline_title, title);
+
gtk_label_set_text(w_headline_date, ctime(&headline->date));
str = ttrss_get_headline_content(headline);
gtk_label_set_text(w_headline_date, ctime(&headline->date));
str = ttrss_get_headline_content(headline);
@@
-398,11
+414,12
@@
int headline_cursor_changed_cbk(GtkTreeView *treeview, gpointer data)
date = headline_get_date(headline);
gtk_list_store_set(GTK_LIST_STORE(model),
&iter,
date = headline_get_date(headline);
gtk_list_store_set(GTK_LIST_STORE(model),
&iter,
- COL_HEADLINE_TITLE,
headline->
title,
+ COL_HEADLINE_TITLE, title,
COL_HEADLINE_DATE, date,
COL_HEADLINE_EPOCH_TIME, headline->date,
-1);
free(date);
COL_HEADLINE_DATE, date,
COL_HEADLINE_EPOCH_TIME, headline->date,
-1);
free(date);
+ free(title);
} else {
log_debug("headline not found");
}
} else {
log_debug("headline not found");
}