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; }