diff options
-rw-r--r-- | src/themes/coco/coco-theme.c | 13 | ||||
-rw-r--r-- | src/themes/nodoka/nodoka-theme.c | 13 | ||||
-rw-r--r-- | src/themes/slider/theme.c | 11 | ||||
-rw-r--r-- | src/themes/standard/theme.c | 11 |
4 files changed, 18 insertions, 30 deletions
diff --git a/src/themes/coco/coco-theme.c b/src/themes/coco/coco-theme.c index c1fa929..ae4037b 100644 --- a/src/themes/coco/coco-theme.c +++ b/src/themes/coco/coco-theme.c @@ -506,18 +506,15 @@ set_notification_text(GtkWindow *nw, const char *summary, const char *body) gtk_label_set_markup(GTK_LABEL(windata->summary_label), str); g_free(str); - if (strstr(body, "&") || strstr(body, "<") || strstr(body, ">") || strstr(body, "'") || strstr(body, """)) + if (pango_parse_markup (body, -1, 0, NULL, NULL, NULL, NULL)) { str = g_strdup_printf("<span color=\"#EAEAEA\">%s</span>", body); + gtk_label_set_markup (GTK_LABEL (windata->body_label), str); + g_free(str); } - else - { - quoted = g_markup_escape_text(body, -1); - str = g_strdup_printf("<span color=\"#EAEAEA\">%s</span>", quoted); - g_free(quoted); + else { + gtk_label_set_text (GTK_LABEL (windata->body_label), body); } - gtk_label_set_markup (GTK_LABEL (windata->body_label), str); - g_free(str); if (body == NULL || *body == '\0') gtk_widget_hide(windata->body_label); diff --git a/src/themes/nodoka/nodoka-theme.c b/src/themes/nodoka/nodoka-theme.c index dcb8449..b4420bd 100644 --- a/src/themes/nodoka/nodoka-theme.c +++ b/src/themes/nodoka/nodoka-theme.c @@ -891,18 +891,15 @@ set_notification_text(GtkWindow *nw, const char *summary, const char *body) gtk_label_set_markup(GTK_LABEL(windata->summary_label), str); g_free(str); - if (strstr(body, "&") || strstr(body, "<") || strstr(body, ">") || strstr(body, "'") || strstr(body, """)) + if (pango_parse_markup (body, -1, 0, NULL, NULL, NULL, NULL)) { str = g_strdup_printf("<span color=\"#000000\">%s</span>", body); + gtk_label_set_markup (GTK_LABEL (windata->body_label), str); + g_free(str); } - else - { - quoted = g_markup_escape_text(body, -1); - str = g_strdup_printf("<span color=\"#000000\">%s</span>", quoted); - g_free(quoted); + else { + gtk_label_set_text (GTK_LABEL (windata->body_label), body); } - gtk_label_set_markup(GTK_LABEL(windata->body_label), str); - g_free(str); if (body == NULL || *body == '\0') gtk_widget_hide(windata->body_label); diff --git a/src/themes/slider/theme.c b/src/themes/slider/theme.c index cf4724a..cc8e420 100644 --- a/src/themes/slider/theme.c +++ b/src/themes/slider/theme.c @@ -513,15 +513,12 @@ void set_notification_text(GtkWindow* nw, const char* summary, const char* body) gtk_label_set_markup(GTK_LABEL(windata->summary_label), str); g_free(str); - if (strstr(body, "&") || strstr(body, "<") || strstr(body, ">") || strstr(body, "'") || strstr(body, """)) + if (pango_parse_markup (body, -1, 0, NULL, NULL, NULL, NULL)) { - gtk_label_set_markup(GTK_LABEL(windata->body_label), body); + gtk_label_set_markup (GTK_LABEL (windata->body_label), body); } - else - { - quoted = g_markup_escape_text(body, -1); - gtk_label_set_markup(GTK_LABEL(windata->body_label), quoted); - g_free(quoted); + else { + gtk_label_set_text (GTK_LABEL (windata->body_label), body); } if (body == NULL || *body == '\0') diff --git a/src/themes/standard/theme.c b/src/themes/standard/theme.c index f13d174..59e07c2 100644 --- a/src/themes/standard/theme.c +++ b/src/themes/standard/theme.c @@ -857,15 +857,12 @@ void set_notification_text(GtkWindow* nw, const char* summary, const char* body) gtk_label_set_markup(GTK_LABEL(windata->summary_label), str); g_free(str); - if (strstr(body, "&") || strstr(body, "<") || strstr(body, ">") || strstr(body, "'") || strstr(body, """)) + if (pango_parse_markup (body, -1, 0, NULL, NULL, NULL, NULL)) { - gtk_label_set_markup(GTK_LABEL(windata->body_label), body); + gtk_label_set_markup (GTK_LABEL (windata->body_label), body); } - else - { - quoted = g_markup_escape_text(body, -1); - gtk_label_set_markup(GTK_LABEL(windata->body_label), quoted); - g_free(quoted); + else { + gtk_label_set_text (GTK_LABEL (windata->body_label), body); } if (body == NULL || *body == '\0') |