From 3ef15065a3c866c2413a518c564ced298f861d02 Mon Sep 17 00:00:00 2001 From: Eizen Date: Wed, 8 Feb 2017 21:51:24 -0300 Subject: [PATCH] Fix ignore_newline regardless of markup Fix issue where ignore_newline wouldn't work with other markup options. Fixes #293 --- src/notification.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/notification.c b/src/notification.c index 9e8de86..8aad813 100644 --- a/src/notification.c +++ b/src/notification.c @@ -245,13 +245,7 @@ char *notification_replace_format(const char *needle, const char *replacement, if (markup_mode == MARKUP_NO) { tmp = strdup(replacement); - tmp = string_replace_all("\\n", "\n", tmp); - if (settings.ignore_newline) { - tmp = string_replace_all("\n", " ", tmp); - } tmp = notification_quote_markup(tmp); - ret = string_replace_all(needle, tmp, haystack); - free(tmp); } else { tmp = strdup(replacement); if (settings.ignore_newline) { @@ -269,10 +263,16 @@ char *notification_replace_format(const char *needle, const char *replacement, tmp = notification_quote_markup(tmp); } - ret = string_replace_all(needle, tmp, haystack); - free(tmp); } + tmp = string_replace_all("\\n", "\n", tmp); + if (settings.ignore_newline) { + tmp = string_replace_all("\n", " ", tmp); + } + + ret = string_replace_all(needle, tmp, haystack); + free(tmp); + return ret; }